Hello,
Recently, I read the tutorial on C++ File I/O and tried out the source code example given in the tutorial. I used VC++ 6.0.
The output for the source code is supposed to be ‘ This text will now be inside of example.txt’. However, the output on my pc is only ‘This’.
It seems that spaces prevent the entire string from being displayed because when I used ‘Thistextwillnowbeinsideofexample.txt’, the whole string is displayed on screen.
I think the code related to my question is this:
B_file>>str;
Cout<<str;
May I know what went wrong or is the code wrong?
Please reply….thank you!