0

Is there something like this available in the C standard library:

#define sizeofarr(a)    ( sizeof(a) / sizeof(a[0]) )
Lacobus
  • 1,590
  • 12
  • 20

2 Answers2

2

No. There is not something like that available in the C standard library.

M.M
  • 138,810
  • 21
  • 208
  • 365
2

No there is not such a thing!

For better Macro definition check this link directly:

is-there-a-standard-function-in-c-that-would-return-the-length-of-an-array

or common-array-length-macro-for-c

Allan
  • 12,117
  • 3
  • 27
  • 51