|
|
|||||
|
Get the Ebook
C Tutorial
Source Code
Function Reference
|
getchar()Prototype: int getchar(void);Header File: stdio.h (C) or cstdio (C++) Explanation: This function reads in a character. It returns the character as the ASCII value of that character. This function will wait for a key to be pressed before continuing with the program. Example:
//Example waits for a character input, then outputs the character
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
char a_char;
a_char=getchar();
cout<<a_char;
}
Other Functions
Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today!
Popular pages
Custom Search
|
||||