0

I have been working with C, in TURBO compiler.
Now I have started C++, in VC++ compiler.
But, now, I m unable to clear screen (clrscr() don't work), can't write at any desired location (gotoxy() don't work)
Can anybody plz tell me their equivalents ?

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by andor
0

Can anybody plz tell me their equivalents ?

system("cls"); for clearing the screen. This is NOT portable so it's not a good thing to use it. Why do you need it? Gotoxy(); is a different story. You first need a handle to your console window, use GetConsoleWindow() for that. Then when you have the handle use SetConsoleCursorPosition() to set the cursor.

Edited by Nick Evan: n/a

0

Well the best is to avoid non standard functions so you will not have this type of problems. For clrscr() read this.

0

Well the best is to avoid non standard functions so you will not have this type of problems. For clrscr() read this.

I like option 4....

Edited by Nick Evan: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.