Is there a way to find how many values an array has? Detecting whether or not I\'ve reached the end of an array would also work.
I provide a tricky solution here:
You can always store length in the first element:
length
// malloc/new arr[0] = length; arr++; // do anything. int len = *(arr-1); free(--arr);
The cost is you must --arr when invoke free
--arr
free