Possible Duplicate:
How to find the sizeof(a pointer pointing to an array)
I tried this code:
#include<stdio.h>
int dime(int v[]){
int i= sizeof v / sizeof *v;
return i;
}
int main() {
int v[10]={1,2,3,4,5,6,7,8,9,0};
int i= dime(v);
printf("The size of v is %d\n",i);
return 0;
}
and it gives me that the size is 1, I also tried changing *v to v[0] and it didn't solve the problem... Can anyone help?
BTW don't know if it is useful (maybe just to know the size of an integer), but I'm running Eclipse in a Ubuntu 32-bit virtual machine.
Thank you!