Jan 23, 2007 hii guys the dev-c compiler does not support conio.h but i want to use it any way i want to use the functions clrscr and gotoxy. Insert at the top of your files #include ' conio2.h' The file should be in your project directory or project search path (include) Maybe you only missed a '.' Conio H C; C Conio Library. Conio.h is packaged with C-Free 5.0 Pro, MATLAB R2009a, and Orwell Dev-C 5.11. In this article, you will find detailed conio.h information, a H file troubleshooting guide, and a list of versions that are available for free download. Analog style levels. Dev C Libreria Conio Hd. C Conio Library. Dev C Libreria Conio Hindi. Function getch in C program prompts a user to press a character. It doesn't show up on the screen. Its declaration is in 'conio.h' header file. The function is not a part of standard C library.
For use on POSIX platforms (like Ubuntu): NCurses
For use on Windows: PDCurses
Both are highly compatible and, unless you are doing something the documentation says is specific to one or the other, they should work identically.
Here are some useful links:
Links for getting started: http://www.cplusplus.com/forum/windows/15935/#msg79025
Basic example ('Press the 'any' key'): http://www.cplusplus.com/forum/general/497/#msg1734
Informative example: http://www.cplusplus.com/forum/beginner/4520/#msg19965
Basic color example: http://www.cplusplus.com/forum/general/11032/2/#msg52617
Another color example: http://www.cplusplus.com/forum/general/11032/#msg52049
Wikipedia article & links: http://en.wikipedia.org/wiki/Ncurses
'NCURSES programming HOWTO': http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
Be sure to look around for good documentation too. A good start is to Google for 'man curses'.
Hope this helps.
Function getch in C program prompts a user to press a character. It doesn't show up on the screen. Its declaration is in 'conio.h' header file. The function is not a part of standard C library.
Use Conio.h In Dev C++ Program
C programming code for getch#include <stdio.h>
printf('Waiting for a character to be pressed from the keyboard to exit.n');
When you run this program, it exits only when you press a character. Try pressing num lock, shift key, etc. (program will not exit if you press these keys) as these are not characters.
Try running the program by removing getch. In this case, it will exit without waiting for a character hit from the keyboard.
How to use getch in C++#include <iostream.h>
cout <<'Enter a character';
Using getch in Dev C++ compiler
Function getch works in Dev C++ compiler but it doesn't support all functions of 'conio.h' as Turbo C compiler does.
Function getchar in C#include <stdio.h>
A common use of getch is you can view the output (if any) of a program without having to open the output window if you are using Turbo C compiler or if you are not running your program from the command prompt.