Two things:
First, you forgot to add the first number to the total.
Second, with while(!source_file.eof()) you run through the last line twice.
Therefore, instead of
10+20+40+10+12 = 92
you get
20+40+10+12+12 = 94
Reputation Points: 42
Solved Threads: 13
Junior Poster in Training
Offline 90 posts
since Sep 2008