I understand that passing an array to a function in C passes a pointer to the first element. Lets say I have a function, and receive an array of integers. Is there a way to get the number of elements in the array, without passing the size as an argument, or using a sentinel value? I want something portable, similar to looping through a string and counting until getting to '\0'. Thanks!
I tried looping through and using '\0' but the result differs alot. Any tips?