Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Example waits for a character input, then outputs the character
- #include <cstdio>
- #include <iostream>
- using namespace std;
- int main()
- {
- char a_char; //Declare char Variable.
- a_char = getchar(); //set a_char variable to function getchar()
- cout << a_char << " was the character you input." << endl;; //So when the user now inputs a chracter it will automatically print it out on the screen. :)
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement