Can someone help me figure this out?
I think this is not possible... Unless i pass another parameter with the size? I'm looking to avoid it.
How could I do this?
int size(int *array){
return (sizeof(array) / sizeof(int));
};
int main(int argc, const char * argv[])
{
int array[] = {1,2,3,4};
printf("%d", size(array) );
return 0;
}
Thank you!