-
Is gotoxy ansi?
I have written a dos prog for borland c, it uses gotoxy() for nearly all its layout. But when I tried to compile in MSVC++ it just can't find gotoxy in the libs.
So is gotoxy ansi or do i have to find an alternative to gotoxy() for my msvc++ port?
This is a very big upset as I am writting it in ansi c for the sole purpose of compatibility.
any help on getting gotoxy working in mscv or alternative functions would be apreciated.
Thanks.
-
No gotoxy isn't ansi standard and msvc dosen't have it. However all is not lost:
Code:
#include <windows.h>
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUTHANDLE),coord);
}
[edit] Arrrghhh Why the feck wont the SetConsoleCursorPosition function display on one line
-
Thanks,
still solve the main problem though.
unless I use some kind of #ifdef on which compiler is bing used.
I will try anyway.