-1

I am new to C. What is the use of the gotoxy function? I read it can be used only in a console.What does that mean? Can someone give me an example where it is been used in a legit way?

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
user128949
  • 19
  • 1
  • 4
  • 4
    According to Google "Gotoxy" is a media company that creates and edits 3d graphics, animations and multimedia. But you are looking for the declaration in conio.h I guess. – Kijewski Aug 15 '14 at 15:09
  • 2
    You should really not be using that function, it is non standard and has some serious flaws. It would be better to tell us what OS you are writing for so we can find you the appropriate function to use instead. – Vality Aug 15 '14 at 15:12
  • 1
    http://www.programmingsimplified.com/c/conio.h/gotoxy is the first google hit and has an example. – mch Aug 15 '14 at 15:13

1 Answers1

4

Your Google skills are weak. Try "gotoxy conio man": http://code-reference.com/c/conio.h/gotoxy.

gotoxy

void gotoxy(int x, int y);

places cursor at a desired location on screen.

Example code:

#include <stdio.h>
#include <conio.h>

int main( void )
{
   int x, y;
   x = 42;
   y = 42;
   clrscr();
   gotoxy(x, y);

   printf("gotoxy jumps to cursor position x42 y42.");

   getch();
   return 0;
}

Community
  • 1
  • 1
Kijewski
  • 25,517
  • 12
  • 101
  • 143