answersLogoWhite

0


Best Answer

what is getch()and their use

Function getch waits for a single keypress (without line-buffering and echoing).

In: ncruses.h (unix) or conio.h (dos).

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

It has no use in C++ -- it is a hangover from C contained in the non-standard header, conio.h. Its purpose is to retrieve a character from the console without echoing to stdout (std::cout in C++). It was typically used in "Press any key to continue" applications in C (but not C++) but since the input is unbuffered, the onus is upon the programmer to handle buffering.

The following is an example in C (invalid for C++):

#include

#include

void main()

{

printf("Press any key\n");

getch();

}

The following is the C++ equivalent:

#include

int main()

{

std::cout<<"Press any key"<

std::getchar();

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

getch() is for waiting the o/p screen til we enter the inputs

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

GET CHaracter (with Echo). See the Help for details.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the definition of 'getch' in c programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can you replace getch of C programming in Linux without using iostream header?

There is a 'getch' in 'conio.h' which has nothing to do with 'iostream'.


What is function get in C programming?

There is no 'get' in the standard libraries, but for 'getc', 'getch', 'getchar', 'fgetc' etc you can find useful information in the help/manual.


Create a spiral in C programming?

create spiral in c programming?


What is a C compiler as used in C programming?

In C programming, C compiler is user to translate C source into C object module.


Name of object oriented programming language?

C++ is the name of a programming language.

Related questions

Can you replace getch of C programming in Linux without using iostream header?

There is a 'getch' in 'conio.h' which has nothing to do with 'iostream'.


Definition of C programming and C?

lkjhktrhkhkrgt


What is the use of getch in C programming?

We use getch() function to hold the screen so that we can see the output but in real it is use to take a input of a character from the console window. Read this out -


What is function get in C programming?

There is no 'get' in the standard libraries, but for 'getc', 'getch', 'getchar', 'fgetc' etc you can find useful information in the help/manual.


Definition of directories in c?

Directories have nothing to do with a programming language.


What is the function of getche in programming c?

Function getche is Borland-specific function declared in conio.h, it does the some thing as getch, but echoes the character on the screen.


What is the use of using C programming?

We use getch() function to hold the screen so that we can see the output but in real it is use to take a input of a character from the console window. Read this out -


What is c and c in computer programming?

C and C++ are both high-level programming languages.


Create a spiral in C programming?

create spiral in c programming?


C programming language bsc it notes?

different between defining value definition section and defining value declaration section


What use getch function in c language?

Gets one character (or keystroke) without buffering or echoing; beware: getch is not part of the standard library.


What is the definition of c sharp programming language?

C# is a derivative of C++, designed to allow C++ programmers to take advantage of the .NET environment. Officially, it is an object oriented language that encompasses strong typing and component orientation.