Clearing the screen

What should I type in C to clear text the screen from text(in MS-DOS programs).


URL:http://5thvortex.cjb.net

Comments

  • : What should I type in C to clear text the screen from text(in MS-DOS programs).

    :



    Some compilers come with a function called "clrscr" which I belive is in the header conio.h or whatever it's new counterpart is. You would call it in your program as follows:



    clrscr(); // simple as that



    if your compiler doesn't have that, write your own subroutine about 3 or 4 lines long. Just ouput the numbers (characters) in an escape sequence 27, 91, 50, 74. I defined them as integer and wrote them to the screen as character. In dos you will also have to add ANSI.SYS to your config.sys file for the latter to work.



    good luck, Rolf




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories