Problem with reading data from file
Hi everybody. I have problem with reading data from file.
I think this code must work but it doesnt works. Please help.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string s[100] = {"0"};
int i=0;
ifstream fin;
ofstream fout;
fin.open("C:\a.txt");
fout.open("C:\b.txt");
while(!fin.eof())
fin >> s[i];
fin.close();
fout << "akmal";
fout.close();
return 0;
}
|
Define "doesn't work".
Line 10: s[100] can be left uninitialized.
Topic archived. No new replies allowed.