Thread: Conio.h

  1. #1
    Seal
    Guest

    Conio.h

    In Visual C++ the header file "conio.h" doesn't work. Do you know
    where i can find a way to make goto(x,y) work?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    conio.h in VC++ doesn't contain gotoxy. conio is a nonstandard header so it's a toss-up whether or not the function you want will be supported. Look in the cprogramming.com FAQ for a way to write your own gotoxy for Windows.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Seņor Member
    Join Date
    Jan 2002
    Posts
    560
    Code:
    void gotoxy(int x, int y)
    {
       COORD coord;
       coord.X = x;
       coord.Y = y;
       SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
    }
    Declare that and you can call it just as if it were in conio.h.
    BTW, dimentions are 80X50 i think.

  4. #4
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    My conio.h is screwed up bad.
    I looked in it and found line with some getch() code but when i included it and tried using getch() it doesnt work!!
    And isnt clrscr() in conio too?
    That one aint working either...
    What's wrong????

  5. #5
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Originally posted by ErionD
    My conio.h is screwed up bad.
    I looked in it and found line with some getch() code but when i included it and tried using getch() it doesnt work!!
    And isnt clrscr() in conio too?
    That one aint working either...
    What's wrong????
    Have you tried _getch() and _clrscr()?

    What errors do you get, exactly?

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >That one aint working either...
    Well, you could think portably and just not use conio.h

    -Prelude
    My best code is written with the delete key.

  7. #7
    Unregistered
    Guest
    That's how to manage without conio.h
    http://www.cprogramming.com/cboard/s...3&pagenumber=2

  8. #8
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    Never tried that _ thing... thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. conio.h not working in *nix
    By wise_ron in forum C Programming
    Replies: 2
    Last Post: 05-04-2006, 01:54 PM
  2. conio.h in Visual C++ ?
    By Born_2B_Alone in forum Windows Programming
    Replies: 3
    Last Post: 09-22-2004, 07:32 PM
  3. Getting textcolor in conio.h to work with Win32
    By MMD_Lynx in forum C Programming
    Replies: 5
    Last Post: 09-02-2004, 01:32 PM
  4. conio.h
    By Jaguar in forum Linux Programming
    Replies: 10
    Last Post: 10-17-2002, 01:12 AM
  5. Conio.h file problems
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 05-23-2002, 01:44 PM