in anjuta c++ , Kdevelope c++ , gcc and g++ ..
when i use getch and include conio.h i find syntax errors .
in which header file can i find getch() or any function similar to it ?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
getch()
You have to use the ncurses library. Here is a dumb example:
You have to link this code with the -lncurses switch.
See the manual page of ncurses for more info.
Code: Select all
#include <curses.h>
int main() {
int code;
initscr();
while (1) {
code=getch();
printf("Entered: %c\n\r",code);
}
}
See the manual page of ncurses for more info.
well try this:
and take a look at this:
http://en.tldp.org/HOWTO/NCURSES-Progra ... index.html
Code: Select all
#include <ncurses.h>
int main() {
int c;
initscr();
raw();
c = getch();
printw("You have pressed: %c",c);
getch(); //second time just to freez screen
endwin();
return 0;
}
http://en.tldp.org/HOWTO/NCURSES-Progra ... index.html