472,342 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,342 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 2511
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...
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'...
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...
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...
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...
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...
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...
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.....
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: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.