hello,
my code is to read a file and inserting it to a list and type it to a nother file my problem is with files when opening it it already be opened but i reads no thing from the file and i don't know why?
i want to know the reason.
Thanks.
my code:#include"ordering.h"
using namespace std;
int main()
{
ordering A;
ifstream in;
bool flag;
string line;
in.open("C:\\infile.txt");
while(! in.eof());
{getline(in,line);
A.inorder_insertion(line);
}
in.close();
ofstream out;
out.open("C:\\outfile.txt");
flag=A.inorder_first(line);
while(flag){
out<<line<<endl;
flag=A.inorder_next(line);}
out.close();
return 0;
}
my code is to read a file and inserting it to a list and type it to a nother file my problem is with files when opening it it already be opened but i reads no thing from the file and i don't know why?
i want to know the reason.
Thanks.
my code:#include"ordering.h"
using namespace std;
int main()
{
ordering A;
ifstream in;
bool flag;
string line;
in.open("C:\\infile.txt");
while(! in.eof());
{getline(in,line);
A.inorder_insertion(line);
}
in.close();
ofstream out;
out.open("C:\\outfile.txt");
flag=A.inorder_first(line);
while(flag){
out<<line<<endl;
flag=A.inorder_next(line);}
out.close();
return 0;
}