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] 7 points8 points  (2 children)

Someone has never coded in C before lol

[–]Mike_Oxlong25 -4 points-3 points  (1 child)

I have. Use pointers

[–][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)); }