Can someone teach me how to use this function and what it can do?
Can someone teach me how to use this function and what it can do?
Of course, that's just a guess, since gotoxy() is not a standard function. For all that I know, it could be a function that calculates pi, or returns a boolean for the planet (true if it's got oxygen, false if there is no oxygen), or something completely different. Of those choices, I suspect the "move the text cursor to X, Y" is the most common.Code:gotoxy(10, 12); // places the cursor at x=10, y=12. printf("Hello, World\n");
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Why does the gotoxy() function doesn't work
it says it's an undeclared identifier
You have to include the header file for the particular version of gotoxy that you want to use (possibly conio.h).
Or perhaps the compiler + C library doesn't have one (for example Visual Studion doesn't have one). As I said, gotoxy() IS NOT A STANDARD FUNCTION, so a compiler vendor may choose to not supply that function [even standard functions are sometimes not supplied, but then you usually get a bit of information somewhere in the documentation to say that "functionX is not provided because on OS Y, there is no underlaying function to support that function." or some such.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I have written a function that does this and posted it on the boards. Just do a search. Though it may be too many years back to still be floating around. I am surely not the only one who has written a gotoxy(). So if no one else here has done it, just hit up Microsoft or google.