Suppose that I have the following c function:
int MyFunction( const float arr[] )
{
// define a variable to hold the number of items in 'arr'
int numItems = ...;
// do something here, then return...
return 1
}
How can I get into numItems the number of items that are in the array arr?
Unfortunately you can’t get it. In C, the following 2 are equivalent declarations.
You must pass the size on your own.
In case of
charpointers designating strings the length of the char array is determined by delimiter'\0'.