You get it like this
void f(char * x, int size_of_array)
{
printf("Size %d\n", size_of_array);
}
main()
{
char x[5] = {'a', 'e', 'i', 'o', 'u'};
f(&x[0], 5);
}
Once you pass an array it decays into a pointer of that type, and you loose the ability to get the size of the array via the sizeof macro. You need to pass the number of elements. If your array is of numeric type you can always pass the size of an array as the first element:
void f(char * x)
{
printf("Size %d\n", x[0]);
}
main()
{
char x[6] = {6, 'a', 'e', 'i', 'o', 'u'};
f(&x[0]);
}
But of course in this case there's extra overhead to updating that element to make sure it matches what you expect.