Let's talk about the basic differences.
(1) getch () and getche () FunctionsBoth functions read one character from the keyboard. The call format is:Getch ();Getche ();The difference between the two is that the getch () function does not display
(1) getch () and getche () FunctionsBoth functions read one character from the keyboard. The call format is:Getch ()Getche ()The difference between the two is that the getch () function does not display the characters read back on the display screen
G ++ compile the program to import the getch () function, getch
Note: In ubuntu, G ++ compiles the C ++ program to import the getch () function (the program will continue to run only after a value is input by the standard function, no function
Introduction-Getch Brief IntroductionRefer to the old TC version getch description. (the article introduces a bit narrow, the application point is some dinosaur game era development details)#include /**/int __cdecl getch (void);Remember reading a
This article is for reprint article , document contributor Wdzhangxiang personal website: Www.baidu.com/p/wdzhangxiangFirst of all, don't forget to usegetch ()header file must be introducedconio.h, previously learned C language, we always like to
Getch ()
The header file: conio.h
function Purpose: Read a character from the console
Function prototype: int getch (void)
Return value: The character read
For example:
char ch; or int ch;
Getch (); or ch=getch ();
Use Getch (), wait for you
Getch ():
Header file: conio. h
Function purpose: Read a character from the console, but it is not displayed on the screen.
Function prototype: int getch (void)
Returned value: read characters
For example:
Char ch; or Int ch;
Getch (); or
Http://baike.baidu.com/view/675106.htm Getch ()
Header file: conio. h
Function purpose: Read a character from the console
Function prototype: int getch (void)
Returned value: read characters
For example:
Char ch; or Int ch;
Getch ();
Original: Getch (), Getche (), and GetChar () functionsGetch (), Getche (), and GetChar () functions(1) Getch () and Getche () functionsBoth of these functions read a character from the keyboard. Its invocation format is:Getch ();Getche ();The
EOF
EOF (end of file) is a status returned by the file read operation. It is not a value read from the file, instead, it is a return value when the file reading function reads the end Of the file or cannot read down. The returned value is generally-1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.