how to use gotoxy()??

This is a discussion on how to use gotoxy()?? within the C Programming forums, part of the General Programming Boards category; I need an example of using the gotoxy() function.(using Dev-C++ compiler) Tell me what is wrong with this example program.. ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    how to use gotoxy()??

    I need an example of using the gotoxy() function.(using
    Dev-C++ compiler)

    Tell me what is wrong with this example program.. there is an error which is "C:\WINDOWS\TEMP\cc7HDdgb.o(.text+0x33):delete~1.c : undefined reference to `gotoxy' "


    #include<stdio.h>
    #include<windows.h>
    #include<conio.h>
    int main()
    {
    printf("Hello!");
    gotoxy(10,10);
    printf("Hello!");
    system("PAUSE");
    return 0;
    }
    anyone has any suggestions??

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    gotoxy() is not a standard function. From one of the FAQ's on THIS WEBSITE you can find:

    Q. No, really - I just want to do gotoxy!!!
    A. Sigh...



    #include <windows.h>

    void gotoxy(int x, int y)
    {
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
    }

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Talking

    All right!! Thanks alot. it worked

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    1
    sir gotoxy 1st before printf

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,033
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by sadamasam View Post
    sir gotoxy 1st before printf
    Do you really think he hasn't figured it out in the past 7 years???
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is gotoxy??
    By Beachblue in forum C Programming
    Replies: 6
    Last Post: 11-23-2008, 01:24 AM
  2. Tic Tac Toe movement
    By $l4xklynx in forum Game Programming
    Replies: 4
    Last Post: 11-06-2008, 07:22 PM
  3. gotoxy(); help!!
    By clique in forum C Programming
    Replies: 2
    Last Post: 10-07-2008, 05:08 AM
  4. Want to see if I am using gotoxy the right way ...
    By o0obruceleeo0o in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2003, 05:17 PM
  5. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 03:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21