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 ?

Recommended Answers

All 4 Replies

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.

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

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....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.