I think this is one of the most common questions that I see when I look through stackoverflow’s C section (and one that I myself struggled with after I first started learning C). C is not like Java. There are no dedicated functions to calculate the length of an array. You can’t even declare an array without first specifying the length (so C can allocate the appropriate amount of memory on the stack).

Anyway, but back to the question at hand: How do you find the length of an array in C? Continue reading “How to find the length of an array in C”