I've been programming a command line 'text editor'
The problem I'm facing is that, I want to make the implementation OS independent. That is, I'd like my code to work in both Linux and Windows. But the problem is, I can't use 'conio.h' as it is OS dependent. I've searched the web and found out there is no alternative for this header file (which is OS independent) and there is neither a similar one in linux.
I'm finding hard without this header file but I'm determined not to use it...
please help...
PS: some of the methods in conio.h which i was using previously were
1 2 3 4 5
int getch(void); //unbuffered input and doesn't echo on screen
int getche(void); //unbuffered input but echos on screen
void gotoxy(int x, int y); //moves the cursor to the coordinates specified
int wherex(void); //returns the x coordinate of the cursor's position
int wherey(void); //returns the y coordinate of the cursor's position
you also can use this header file for linux systems and conio.h for windows systems.. just write some macro lines so that it chooses the correct system and define the header part... this is what i used for listening to keyboard input with the termios.h for linux...
i dont know if this is the best way for you... i hope this helps...
check out that ncurses library too... its maybe better i guess...
cheers..
p.s.
this code is not mine, i found it on the internet and modified it..
thank the maker