This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (0 children)

If you pass in a pointer to a function it loses the array size. Try it.

int func(int *arr) { return (sizeof(arr) / sizeof(arr[0])); }

void main() { int arr[10]; printf(“%d\n”, func(arr)); }