Please help me how to use clrscr(); and gotoxy(); functions in other C Compilers?
playagain
0
Newbie Poster
Recommended Answers
Jump to PostPlease read this thread. posted a couple days ago
gotoxy is a borland-specific function which was never implemented by any other compiler. If you want to use it with other compilers you will have to write your own gotoxy() function using operating system specific api calls.
Jump to Postif you are using visual C++ it is very simple to write your own functions.
// function definition -- requires windows.h
void gotoxy(int x, int y)
{
HANDLE hConsoleOutput;
COORD dwCursorPosition;
cout.flush();
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
}// function definition -- …
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
guy40az
0
Junior Poster in Training
playagain
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
guy40az
0
Junior Poster in Training
karrl
-1
Newbie Poster
jonsca
commented:
Nope
-1
nbaztec
commented:
huh?
+0
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.