Hello guys,
I'm fully aware I can clear the command line interface with:
however doesn't this limit my program to Windows only?, if so are they any good techniques to maintain portability.Code:system("cls");
Hello guys,
I'm fully aware I can clear the command line interface with:
however doesn't this limit my program to Windows only?, if so are they any good techniques to maintain portability.Code:system("cls");
Last edited by Cero.Uno; 04-21-2008 at 03:10 PM.
Code:for (i = 0 ; i < some_number_that_you_guess_is_the_number_of_console_lines ; i++) printf("\n") ;
Mainframe assembler programmer by trade. C coder when I can.
I don't think there is a portable solution, but most terminal emulators support escape sequences:
e.g. printf("\033[2J\n"); /* vt100, clear screen escape sequence */
Additional code is needed to move the cursor.
This work on unix-like systems, don't know with windows.
Or look in the Frequently Asked Questions: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.