conio?

Hello everyone.

i put this on windows programming cause i think "conio/conio.h" is w\ windows right??

i used conio in this class of mine and i get this error all the time with gotoxy() function and textcolor();

this is the class:

//davezz !@!@*!)(@*)!*@!*(@!*@(

#include<iostream>
#include<string>
#include<conio.h>
#include<stdio.h>
using namespace std;

void center(char title[10], int y, int c);

void center(char title[10], int y, int c)
{
gotoxy(40-strlen(title)/2,y);
textcolor(c);
printf("%s",title);
textcolor(7);
}


any ideas are really appreciated. ^^
by the way, just ignore the comments XD
conio.h is not the library you (and everyone) thinks it is.
(What you want is the old Borland additions.)

If you are using MinGW, you can get a drop-in replacement here
http://conio.sourceforge.net/docs/html/conio2_8h.html
(as soon as sourceforge comes back online)

Otherwise you'll have to code the functions yourself.

gotoxy() and clearscreen() from my Gosper Glider
http://www.cplusplus.com/forum/lounge/75168/

how to set the text color:
http://www.cplusplus.com/forum/general/9974/#msg46705
plus something useful to play with:
http://www.cplusplus.com/forum/general/48596/#msg264748


If you want to be able to do this on *nixen as well, then you might as well just dump conio* and instead jump into using Curses:
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
There's a bit of a learning curve, and messing with colors is obnoxious, but not impossible. Here's an example:
http://www.cplusplus.com/forum/general/11032/#msg52049


Hope this helps!
thanks Duoas!! really helps
Topic archived. No new replies allowed.