0
How to use gotoxy(x,y) function using codeblocks . My program works properly in turbo C but in other compilers it's not wrking.
I used # include< iostream> and using namespace std; though
3 ответов
+ 2
I would suggest don't use goto statement.Because its make your Program Confusing. Yeah for small Program you can use it.
+ 2
In windows, you have a small alternative...
In codeblocks write the following function...:
#include<windows.h>
void gotoxy(int x=0,int y=0)
{
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
COORD new={x,y};
SetConsoleCursorPosition(out,new);
}
int main()
{
gotoxy(2,2);
cout<<"Hello";
}