John den Haan <> writes:
> When I use putchar to fill up an entire screen (of 80x25) with text,
> it seems to leave an empty line at the end, thus forcing me to scroll
> upwards in to see the first line. This forces me to repositioning the
> cursor to the first line, which costs computer power. I know the loss
> is negligible, but it's more a matter of principle: how to prevent
> this line-wrapping behaviour?
You didn't tell us *how* you use putchar to fill up the screen.
Do you write a newline character at the end of each of the 25 lines?
If so, on a typical display, the last newline will naturally cause the
disply to scroll up, leaving the cursor at the beginning of a blank
line.
If you print characters without a terminating newline, you should call
fflush(stdout) to ensure that they're displayed. (But some displays
may not be able to display a character in the lower right corner.)
Details of how displays work are target-specific, but we'll be glad to
help with any C issues.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.