I need the use the length of a passed array 'X' in a function. The array is created in the main function. I print out the following from the main function:
std::cout << "\n" << sizeof(X);
which yields: 400
The array 'X' is then passed to a function where the length of X is needed. I print out the following from the function:
std::cout << "\n" << sizeof(X);
which yields: 8
I am expecting 400, as my array has 100 float elements. Why does sizeof() not return the same size as when it was called in the main function? (I assure you that there are actually 100 elements in array X because the rest of the program works.)
Thanks for any help!