View Full Version : using getch() in gcc
FuzZy2006
November 15th, 2006, 08:58 AM
Can you suggest me something similar to the getch() function in c++ that I can use in gcc?
sweemeng
November 15th, 2006, 09:22 AM
there is something similar under the ncurse library. go check it out.
FuzZy2006
November 15th, 2006, 09:44 AM
i did sudo aptitude install ncurses. in a ncurses tutorials it says that I should use gcc -lncurses program.cpp to run the program. when i put #include<ncurses.h> in the program, it still says that it doesn't find ncurses. ](*,)
engineer
November 15th, 2006, 09:57 AM
you need the ncurses-dev package.
it contains the header files, you need
Horsman
November 16th, 2006, 01:44 AM
I'm pretty sure you just want something like:
#include <iostream>
main(){
char c; // new char c
std::cin >> c; // read one char from the standard input stream
std::cout << c << std::endl; // write char c to standard output stream
}
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.