M
monkeys paw
I am passing an array to a function. My first attempt was like so:
char *ary[] = {"an", "array"};
my_sort(ary);
But that doesn't work because the function my_sort cannot
determing the size of ary. So i had to do this:
nelems = sizeof(ary) / sizeof(char *);
my_sort(ary, nelems);
Why is this?
char *ary[] = {"an", "array"};
my_sort(ary);
But that doesn't work because the function my_sort cannot
determing the size of ary. So i had to do this:
nelems = sizeof(ary) / sizeof(char *);
my_sort(ary, nelems);
Why is this?