C: length.h module.

Usage:

int array[] = {9,4,8,1,7,0,3,2,5,6}; // test array

int length = LENGTH(array);


 https://github.com/pereiradaniel/c_programs/blob/master/length.h

#define LENGTH(a) sizeof(a) / sizeof(a[0]) // function-like macro

Popular posts from this blog

C++ Crash Course: Solutions to Exercises in Part 1, Chapter 1.

C programming and relevancy