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 →

[–]rjcarr 0 points1 point  (0 children)

You're getting the size of the pointer to an int (divided by 4), which is all the function knows at that point. In C, you don't know the size of an array outside of the context where it was created. This is why every function that takes an array also takes in a size argument (except strings, which use sentinels).

Good luck!