Possible Duplicates:
Sizeof an array in the C programming language?
determine size of array if passed to function
Hello,
how can I get the size of an array that is passed to a function ? I have this code, but it is not working for me
float verts[] = {
-1.0,1.0,1.0,
1.0,1.0,1.0,
1.0,-1.0,1.0,
-1.0,-1.0,1.0,
-1.0,1.0,-1.0,
1.0,1.0,-1.0,
1.0,-1.0,-1.0,
-1.0,-1.0,-1.0
};
void makeVectorData(float p_vertData[]) {
int num = (sizeof(p_vertData)/sizeof(int));
cout << "output: " << num << endl;
};
thanks,