How to realize a getch function in standard C/C++

S

Shugong Wang

getch() function is not a standard C/C++ function. Thought gcc provieds
ncurses.h and a getch() function is realized, I still want to know how to
realize a getch() function in standard c or c++.
 
R

Raymond Martineau

getch() function is not a standard C/C++ function. Thought gcc provieds
ncurses.h and a getch() function is realized, I still want to know how to
realize a getch() function in standard c or c++.

There is no standard way of doing this in C or C++. The only proper method
is to use is third-party libraries, such as ncurses or pdcurses.

You might be able to use getchar(), or retrieve a character from cin, but
that's about it for the standard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top