Code:
int main()
{
int my_arr[3] = {1, 2, 3};
....
my_fun(my_arr);
}
void my_fun(int array[])
{
/*need to determine the number of elements in array*/
x = num_of_items_in_array;
/*perform computation*/
}
It so happens that there is no clear way to determine the num of items in a passed array, since integer arrays are not null terminated.
Can anyone help me here? Or would I have to explicitly tell the function how many items are there int he given array?