Its impossible to do it without passing the length of thr array as a parameter.
here is a possible solution :
void foo(unsigned *p, int length)
{
cout << length << '\n';
}
int main (int argc, const char * argv[]) {
unsigned p[] = {1,2,3,4,5,6,7,8,9,0};
int length=sizeof(p)/sizeof(p[0]) ;
foo(p,length);
return 0;
}
Good luck
