I want to read and write to text file at the same time. But I have met some problem. Here is my code:
My text file, for example is: hello \n afternoon \n morning
f>>t; //read first line of file
f<<"C++"<<endl; //printf C++
f<<"Programming"<<endl; //print Programming
f>>t; //Read file
After run, my text file is no change. and t is just hello in both two cases.
I cannot understand why like that. Help me about this problem,please