Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

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?

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

I used the condition While (!file.eof()), as u said with the special condition, wat function and arguments to replace file.eof()?

OpenStudy (anonymous):

Please post your program here. If it is written in C/C++/VB .NET/C#, I will rectify it for you....:D

OpenStudy (anonymous):

Thanks all, I figured it out.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!