gotoxy() function in Code::blocks(gcc compiler) using C
In Turbo C/C++ and Borland C++ compiler, gotoxy() is build in function. You need not have to write its function definition. All you have to do is call the function with arguments as x and y coordinate. But in modern C compilers like gcc and IDE Code::Blocks, gotoxy() is not build-in function, you have to define it before use them. The following code is the function definition for gotoxy(). Remember: This function only works on windows, because the function definition includes functions of header file “windows.h”. So to use gotoxy() you must include “windows.h”.
COORD coordinate = {0,0}; //initialization void gotoxy(int x, int y){ //function definition coordinate.X = x; coordinate.Y = y; SetConsoleCursorPostion(GetStdHandle(STD_OUTPUT_HANDLE),coordinate); }
NOTE: coordinate (0,0) is left-top corner of your window.
but it is giving an error that "setconsolecursorposition" is undeclared. first use this function.
Hi Adil, The error comes from here:
SetConsoleCursorPostion(GetStdHandle(STD_OUTPUT_HANDLE),coordinate);
We must change Postion by Position.
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
Regards
same here , undefined reference to `SetConsoleCursorPostion'
It gives an error that "expected ';' before 'COORD' "… Please help…
I have problem in this… This shows a error as… "expected ';' before 'COORD' "… Please Help
It gives an error that "expected ';' before 'COORD' "… Please help…
how to do make a linklist about the dequeue, dequeue,enqueue
please help me…
Dont write the first linw bro….