1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Rep Power

    How can i use getch?

    i am unable to use getch and putch.
    can i use this with gcc.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Rep Power
    Those are non-standard functions, meaning that they are not supported by the C Standard Library.

    Rather, they come in conio. Just like with any other external function, even standard ones, you need to #include the header file, which in this case would be conio.h. If your copy of gcc does not have that header file, then it does not support conio; look in your compiler's INCLUDE directory.

    If you are using MinGW gcc under windows, then in INCLUDE you should also see a source file, conio.c, which implements part of the conio library. You would need to add that source file to your project.

    In other versions of gcc, if you have a conio.h header file, then you might have a conio library file in the LIBRARY directory. If that is the case, then you would need to add that library to your project.

IMN logo majestic logo threadwatch logo seochat tools logo