Your number
values are too big to fit into a four-byte signed integer. Maximum value for that is 2147483647 (2^31 - 1), which is why you get that printing out at the end. (You weren't asking about that issue; I don't know how I noticed it myself!)
But what I'm also wondering about is that extra line that you have in between each record. I found this question that discusses fstream
s and delimiters. I wonder if it's getting stuck at the blank line, reading nothing, and then just outputting the same values of last
, first
, uin
, and number
.