|
-
September 21st, 2001, 12:22 PM
#1
How to read ints from a text file
for instance like:
12 32 323 342
12 3213 23 12
and store them into a array
-
September 21st, 2001, 02:25 PM
#2
Re: How to read ints from a text file
Something like this:
#include <fstream>
using std::ifstream;
int main()
{
char *filename = "in.txt";
ifstream in(filename);
int ar[1000];
int i = 0;
while (in)
{
in >> ar[i++];
}
return 0;
}
Please - rate answer if it helped you
It gives me inspiration when I see myself in the top list =)
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
[email protected] | ICQ:57404554 | http://soukhov.com
Member of Russian Software Developer Network http://rsdn.ru
-
September 22nd, 2001, 12:34 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|