I am working on a Dictionary project based on AVL tree.
The Dictionary can add words from the input.txt. Here is the input example:
0 3
sheep,con cuu
mother, me
water, nuoc
0 : the code to show that you are about to add words to the Dictionary
3 : the numbers of words you gonna add
The problem I have is that i cant read the numbers from input.txt.
I called A.Read();
cout<<"\n\n";
DICTIONARY A;
A.Read();
cout<<"\n";
and the content of Read() is:
fstream file;
int nCode;
int nQuantity;
file.open("input.txt",ios::in);
file>>nCode;
cout<<"\n"<<nCode<<"\n";
file.close();
but in the console screen it gives me a rubbish value(attached image)
I also attach my code so it's easy for you to help me out. thnx in advance and sorry for my english :D