Hi,
When I write to the beginning of the file,it always leaves the first line empty,and start writing from the second one.
How can I make it write from the first line,including the first one and on?
Thanks.
views:
584answers:
3
+2
A:
If I understand your question correctly, you are creating a new file or overwriting an existing file and afterwards the file starts with a blank line that you do not want? If so, you are probably printing out a newline ("\n" or endl) at the beginning without realizing it.
Glomek
2008-11-02 17:52:41
A:
Sounds like you are outputting a newline character before the first line . Can you post some code that has the problem?
tvanfosson
2008-11-02 17:53:41
A:
Also, make sure that, if the file is not a new file, that you are not opening the file in 'append' mode.
michalmocny
2008-11-02 19:05:54