How to use conio.h?

Apr 30, 2011 at 6:57am
I'm interested in using conio.h, but I have no idea how to use it, and google has not been helpful. Could someone point me to some kind of conio.h tutorial?
Apr 30, 2011 at 8:05am
conio.h isn't part of the C++ standard.
But well: http://en.wikipedia.org/wiki/Conio.h
Apr 30, 2011 at 4:21pm
Thanks, but doesn't conio.h have some way of using colour in the console?
Apr 30, 2011 at 4:31pm
No, it doesn't.

Are you targeting any one specific platform, like Windows? Or must your code work cross-platform?
Apr 30, 2011 at 4:34pm
windows, and if it's convenient, ubuntu too.
Apr 30, 2011 at 7:39pm
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.
Apr 30, 2011 at 8:41pm
Actually, the whole reason that I am looking into conio.h is that I tried to get pdcurses working for about a week with no success. Do you know an easy way to get pdcurses working with the gnu compiler in code blocks?
Apr 30, 2011 at 8:47pm
Well why are you interested in it at all? Why not just go completely graphical with SDL or SFML or OpenGL or DirectX or WinAPI or QT or any other library/API that lets you program graphically?
Apr 30, 2011 at 8:50pm
Well, I'm planning on using something like that in the relatively near future, but I'm just learning c++ and I thought that a simpler display would be easier. Do you have a recommendation for a graphical library?
Apr 30, 2011 at 8:52pm
Haha as is the custom:

SDL http://lazyfoo.net

SFML http://sfml-dev.org

Both are easy to get up and running quickly.
Topic archived. No new replies allowed.