Use Conio.h In Dev C++

Nothing platform-specific is particularly convenient, but if you wish to do both Windows and *nix then I recommend you to the NCurses library.
For use on POSIX platforms (like Ubuntu): NCurses
http://www.gnu.org/software/ncurses/
For use on Windows: PDCurses
http://pdcurses.sourceforge.net/
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
Basics: http://www.cplusplus.com/forum/beginner/5796/#msg25862
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.

Use Conio.h In Dev C++ Download

2002-01-20 17:11:05 UTC

What Is Conio.h In C++

Dev

A conio implementation for Mingw/Dev-C. #include h Data Structures. Struct textinfo Structure holding information about screen. Struct charinfo Structure used by gettext/puttext. Gotoxy is a standard C function defined in conio.h, but it will not work in ANSI C compilers such as Dev-C. Because gotoxy is a Turbo-C specific function, which means it is not part of the standard. However, if you insist on using console functions, you can define your own function by using member functions available in. Why can't I use conio.h functions like clrsrc? Because conio.h is not part of the C standard. It is a Borland extension, and works only with Borland compilers (and perhaps some other commercial compilers). Dev-C uses GCC, the GNU Compiler Collection, as it's compiler.GCC is originally a UNIX compiler, and aims for portability and standards.

Use Conio.h In Dev C++ Program

Lets try to clear the air about getch() Vs getchar():
They are both prototyped in conio.h, this file is located in the DEV-
CPPINCLUDE folder.
getchar() is similar to C's gets() in as much as the variable is declared as
a char. When event trapping if the programmer wants to use numeric user input
then he/she will have to convert it to an integer using the atoi() function.
Also when the user presses a key the have to hit enter afterwards for the
variable to read.
getch() is totally different in as much as the variable is declared as an int
so the program can read both Alpha and Numeric results without any
conversions to be done on the programmers end. Also the user just has to type
in the required key and it will be automatically inputted.
Here is a brief example:
#include <conio.h>
void main(void)
{
int ch;
printf ('%s', 'Press a keyn');
ch=getch() this starts the event tripping procedures
switch(ch) { //this tells the program how to handle the user input
case 'a':
printf('%s', 'You pressed the A keyn');
break;
case 'b':
printf('%s', 'You pressed the B keyn);
break
}
}
The last function in this message concerns getche() which performs the same
as getch() with one exception and that is that when the user presses a key
the keystroke is echoed to the screen. This is great for debugging a program.
In closing I'm working on a C tutorial that will include source code and
compiled examples. Any help with this project would be greatly appreciated.
Danny