473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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++.
Jul 22 '05 #1
2 2579
Shugong Wang wrote:
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++.


You can't.
See
http://www.parashift.com/c++-faq-lit...html#faq-15.17

HTH,
- J.
Jul 22 '05 #2
On Sat, 27 Nov 2004 19:18:42 +0800, "Shugong Wang" <wa****@lzb.ac.cn>
wrote:
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.

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Pelo GANDO | last post by:
Hi everybody, It's me again...Pelo, for an other beginner question... What the code should be in C++ to wait for a keyboard entry in order to execute the sequal of my program...
3
by: voidstar | last post by:
Hi, I have the following problem: I use "getch" to monitor keypresses and the I use "cin" to input a string. When I type in 'y', the 'y' character appears, so I need to hit backspace before...
4
by: lior l | last post by:
Hello, I am looking for a C function that works just like getch() in C++, meaning I want the computer to wait for a one byte input and continue (without pressing on the enter key). I have tryied...
4
by: Crow | last post by:
Is there any way to make cin behave like getch()? Specifically, getch() returns immediately after a key is pressed and the cin family of input methods seem to block until a new line is...
9
by: James McLaughlin | last post by:
Hi, Does anyone know if it's possible to write either a getch() (preferably Borland-style) or getche() function in C without it being platform-dependent or otherwise non-standard? If not, can...
1
by: simnav | last post by:
In the following code something strange happens ! If I keep pressed any of ALT+Arrow, keys, they are extracted two times from buffer then getch seems to stop; if I release and press again ALT+arrow...
45
by: simnav | last post by:
In the following code something strange happens ! If I keep pressed any of ALT+Arrow, keys, they are extracted two times from buffer then getch seems to stop; if I release and press again ALT+arrow...
5
by: Sankar | last post by:
Dear all, In my programming snippet compiled in Linux 2.6, I have a getch() , but the program when executed does not wait for my input.. fflush(stdin), fflush(stdout) - All these did not help. ...
16
by: fuzhen | last post by:
If I want to "press any key to continue" in Windows, I can use getch() But the getch() isn't a standard C function So what should I to do in Linux?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.