Actually i'm supposed to use getch(),but since getch() is not available in linux.
I think you are mistaken:
$ man getch
curs_getch(3X) curs_getch(3X)
NAME
getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get (or push back) characters from curses
terminal keyboard
...
$ man getch
curs_getch(3X) curs_getch(3X)
NAME
getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get (or push back) characters from curses
terminal keyboard
...
To copy to clipboard, switch view to plain text mode
You need to include the relevant curses header, initialise and cleanup curses, and link the curses library.
If you intend turning this into a program that uses Qt then you almost certainly don't want either function.
Bookmarks