#include <conio.h>
#include <stdio.h>
int mygetch (void)
{
int x;
x= getch ();
if (x==0) x= 1000+getch();
return x;
}
int main (void)
{
int key;
key = mygetch ();
if (key==1059) printf ("F1\n");
else printf ("%d\n", key);
return 0;
}
The purpose of getch() is to input a single character from the input stream.
There is a 'getch' in 'conio.h' which has nothing to do with 'iostream'.
Without the semi-colon, getch is just an expression, not a statement.
give a webkinz code to me ok
char
getch is used for console applications and it's very useful because in a way how windows work when a console application has finished it's part windows closes it automatically with the code 0 meaning that program did not have any problems while was running. To prevent automatic shutdown for console applications getch can be used. So, when your program has finished all operations it will wait for an input (basically you will have to press any key to finish the application) from the user.
if you want to give it to him or her then give it to them
there is no code for that
Quote taken from The Unix and Linux Forum: getch() is an ancient DOS syscall from even older versions of Borland Turbo C. Mostly nothing has it these days. Unquote. Search Google with "getch" and have a look through the webpages on the subject. There are no manual (man) pages for getch - I'm using Ubuntu 12.04.
yes !! its safe to give out your friend code!!!
plese can somebody give me there vmath code
getch() is a way to get a user-inputted character. It can be used to hold program execution, but the "holding" is simply a side-effect of its primary purpose, which is to wait until the user enters a character. getch() and getchar() are used to read a character from screen.