adding numbers(integers) from a .txt file

Hey guys

How do you add numbers(integers) from a .txt file and then output it on C++.

Note: each number is on a separate line yet are under the same heading

Thanks
http://www.cplusplus.com/forum/general/11238/

Why is it that people think posting the same question a zillion times will get them better help?
I'm gonna start deleting my answers in other threads when I find duplicates.
Last edited on
im not repeating anymore answers about fstream, i have probably copy & pasted my own reply about 6 times today, search before you post. If you cant find anything google.. if your still lost post a question. ok now for your question ill just nudge u in the right direction.

1) look at ifstream to read in txt file
2) look up counters on how to count line numbers
3) use getline() to get text from that line number
4) store that line in a variable, then do what you want with it
Topic archived. No new replies allowed.