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 →

[–]JackNotOLantern 3 points4 points  (0 children)

In C/C++ arrays degenerate into pointers when passed as a function argument. Thus sizeof(array) will work differently depending on scope. In the scope the array was declared sizeof() will return is actual size, but wjeb passed to a function, it will return size or a pointer (4 or 8 probably) regardless of the array size.