libexplain  1.4.D001
Defines
libexplain/sizeof.h File Reference

Go to the source code of this file.

Defines

#define SIZEOF(a)   (sizeof(a) / sizeof(a[0]))
#define ENDOF(a)   ((a) + SIZEOF(a))

Define Documentation

#define ENDOF (   a)    ((a) + SIZEOF(a))

The ENDOF macro is used to calculate the address of the array element just of the end of an array. This is useful in writing for loops to traverse arrays usuing an elelent pointer.

Parameters:
aThe array of interest

Definition at line 42 of file sizeof.h.

#define SIZEOF (   a)    (sizeof(a) / sizeof(a[0]))

The SIZEOF macro is used to calculate the number of elements in an array. This is usedful in cases when the C built-in sizeof operator would return the size of the array in bytes, but the array elements are larger in size than a single byte.

Parameters:
aThe array of interest

Definition at line 32 of file sizeof.h.