Mail Archives: djgpp/2000/03/10/18:23:42
David Cleaver <davidis AT ou DOT edu> wrote:
> Hello all,
> I'm sorry for posting this seemingly-newbie-ish question here, but I
> can't really find any documentation on what I'm looking for, and
> what I do find hasn't worked so far.
[...]
> Here, cotnum is from a library I'm using which prints a number
> followed by a new-line character. Unfortunately, I want the
> following string in the fprintf to be on the same line as the number
> that was just printed. So, my question is, how do I print the
> "backspace character" (ie, '\0x8')?
That's the wrong question to be asking. Outputting a backspace
character will not (at least not reliably) erase that newline from the
output. If you really want to get rid of that \n, even though it
already sits in the file, your only choice is to re-open the file in
write/append mode, truncate it to one character less than its original
length, and re-open it again for writing.
In the light of that, I'd strongly suggest forgetting about the whole
plan, unless there's strict necessity to do it (order from your boss,
or something).
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -