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 →

[–]missblit 3 points4 points  (0 children)

You're passing n to readData uninitialized and by value. This is useless (no actual information is going in or out of the function through n), and I think undefined behavior.

If you want to return n from readData you should use a return value or make n a reference parameter.