Need problem solver experts: I have a program that read in a file, and then write to another file with any changes made. However, after writing to the file, there is a extra line at the end of the data, which is produced by the endl. Is there any way to delete that endl when writing to the file, or what should i do?
show us the program, which I assume is in C++ Short answer: If you don't want an endl, don't put it in. If you want it everywhere but at the end of the file, include a special condition in the loop that notices when you have reached the end of the loop, in which case you skip adding the endl.
I used the condition While (!file.eof()), as u said with the special condition, wat function and arguments to replace file.eof()?
Please post your program here. If it is written in C/C++/VB .NET/C#, I will rectify it for you....:D
Thanks all, I figured it out.
Join our real-time social learning platform and learn together with your friends!