In my project I have an array of floats which I want to pass through a function. I calculate the size of the array before passing the array through the function and I get the correct size.
I now pass the array as argument to a function and the size is wrong.
float histogram1[ 27 ];
float histogram2[ 27 ];
........ Do stuff ...
// Histogramm size is correct here the output is 27
cout << " histograms size is " << sizeof(histogram1)/sizeof(float) << endl;
ut.categoricalhistogramCompare(histogram1, histogram2);
The first line of my function is:
std::vector<float> Utilities::categoricalhistogramCompare( float histA[], float histB[]){
const int N = sizeof(histA) / sizeof(float);
//Size output here is 2
cout << " size of histograms " << N<< endl;
..... Do stuff .....
}
Any clues why this happens? Is it the way I define the array function arguments?