1
votes

I would like to write 80 (standard conole width) characters in one line without the cursor go to next line. It is only problem when I want to print 80 characters in the last line of console. It cases scrolling that I dont want.

Take a look:

enter image description here

I dont want the newline. any way to do this? :/ Im on Windows, DEV-C++, using WinApi for colors and moving the cursor (the window resize too).

Thanx for any answers.

5
post a code snippet of what you did - Dirk
@Dirk: how would that help? His problem is clearly stated, there is little need for that. - houbysoft

5 Answers

2
votes

Instead of using standard output functions use the Windows Console API to set the cursor position and draw characters. Specifically, take a look at WriteConsoleOutput.

MSDN Console API Docs

1
votes

The only reason why you are on a new line is because the console is not big enought to support the eighty stars.

So it pushed the cursor to the next line.

0
votes

through one or two "\b" at the end it moves the cursor back.

0
votes

For the system-critical console window, the cursor should always stay visible, and the only way for it to do so after you've reached the max number of chars in a line, is to pop up on the next visible line (without actually making any new lines).

0
votes

filter the output either in the originating program or with another program through a pipe. When you have outputted too many characters on a single line, do whatever you like (i.e., drop characters, overwrite, etc....).