By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,813 Members | 2,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,813 IT Pros & Developers. It's quick & easy.

what is the use of gotoxy() in c

P: 1
i am getting unable to find the answer that how gotoxy() is used in c
Sep 8 '10 #1
Share this Question
Share on Google+
2 Replies


Nepomuk
Expert 2.5K+
P: 3,112
Hi!

Put the following code into a file, save, compile, run, see what it does.
Expand|Select|Wrap|Line Numbers
  1. #include <conio.h>
  2. #include <stdio.h>
  3.  
  4. int main(void) {
  5.   int i;
  6.   printf("This is the first line.\n");
  7.   gotoxy(10,4);
  8.   printf("This is the second line.\n");
  9.   gotoxy(20,8);
  10.   printf("And this is line 3.\n");
  11.   return 0;
  12. }
If it doesn't work, you're probably not using a Windows/DOS machine. In that case, you'll have to implement your own gotoxy function, as was done here.

Greetings,
Nepomuk
Sep 8 '10 #2

Expert 100+
P: 2,398
gotoxy() is not in the Standard C Library; thus there is no standard definition of what it does. Functions of the same name from different sources probably do different things. (For example, every main() function does something different.) Where did your gotoxy() function come from?
Sep 8 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.