Thread: gotoxy function

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    34

    gotoxy function

    Can someone teach me how to use this function and what it can do?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Code:
    gotoxy(10, 12);   // places the cursor at x=10, y=12. 
    printf("Hello, World\n");
    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.

    --
    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.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    34
    Why does the gotoxy() function doesn't work
    it says it's an undeclared identifier

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You have to include the header file for the particular version of gotoxy that you want to use (possibly conio.h).

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by tabstop View Post
    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.

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Post your games here...
    By Hammer in forum Game Programming
    Replies: 132
    Last Post: 02-28-2013, 09:29 AM
  2. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  3. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  4. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM