Page 1 of 1

File reading

PostPosted: Aug 18, 2002 @ 9:06pm
by Jay Mattis
Hi everyone,
I've never really done much file I/O with C++ and I was hoping someone could help me with this. I want to read a file that looks like this:

-1
-1
0
0
0
-1
0

etc.

How can I open that file, and then read the numbers in one by one into integers? Basically, I just need to know how to open the file and read it such that I can read one line at a time and convert it into the proper integer. Can anyone help me?

PostPosted: Aug 19, 2002 @ 4:09am
by Dan East

PostPosted: Aug 21, 2002 @ 7:47pm
by Jay Mattis

PostPosted: Aug 21, 2002 @ 7:55pm
by Dan East

PostPosted: Sep 10, 2002 @ 11:36am
by TechMage
"Everybody loves Dan," a new ABC comedy show, premering Sept 18, 2002.

I laughed, I cried, I learned C++. This is the best damn show ever! God bless you ABC! -Martha Stewert

Ae ure do alote of f***ing cursing on that f***ing owe! I f***ing oved it! -Ozzy Osbourne

Very informative. If we had the money we would buy this show from ABC. But, we can only afford dumb and annoying computer nerds. *sigh* -CEO of TechTV

PostPosted: Sep 10, 2002 @ 12:54pm
by sponge

PostPosted: Sep 10, 2002 @ 2:35pm
by Dan East