Thread: quick question about header files

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    2

    quick question about header files

    Hi! I was wondering if anyone might know what header file must be included to use the command gotoxy in c++. Thank you for your help!

  2. #2
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    The question would be, what compiler are you using. This is not part of the IEC/ISO C++ standard definition as far as I know.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    if you have it... them it normally resides in <conio.h>

    if you dont have it..... i.e. msvc.... you can write it yourself.

    Code:
    #include<windows.h>
    
    void gotoxy(int x, int y) 
    { 
        COORD point; 
        point.X = x; point.Y = y; 
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),point); 
    }
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    95
    Yeah, it's in Conio.h, which isn't on most compilers. I tried using it's textcolor function once, but I realized that header wasn't there, so I gave up. It's probably posted somewhere on the internet though...
    Think out of the box! Open Source rules!

    -Breach23

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header files question
    By Programmer_P in forum C++ Programming
    Replies: 8
    Last Post: 05-14-2009, 01:16 PM
  2. Confusion on header and source files
    By dnguyen1022 in forum C++ Programming
    Replies: 4
    Last Post: 01-17-2009, 03:42 AM
  3. Question in including tempolate header files.
    By plutino in forum C++ Programming
    Replies: 7
    Last Post: 12-17-2008, 07:00 AM
  4. C Header Files
    By devarishi in forum C Programming
    Replies: 8
    Last Post: 12-10-2008, 04:53 PM
  5. Help using Header Files
    By d34n in forum C Programming
    Replies: 8
    Last Post: 04-21-2008, 11:06 PM