Created
August 31, 2015 23:42
-
-
Save AndyNovo/3a83311de6966c01cb2f to your computer and use it in GitHub Desktop.
Simple prompt, but without using standard namespace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
std::string prompt_user(std::string input_prompt){ | |
std::string reply; | |
std::cout << input_prompt << std::endl; | |
//std::getline(std::cin, reply); | |
std::cin >> reply; | |
return reply; | |
}; | |
int main(){ | |
std::string response = prompt_user("How are you doing today?"); | |
std::cout << "You said: " << response << std::endl; | |
response = prompt_user("Is it your birthday?"); | |
std::cout << "You said: " << response << std::endl; | |
return 0; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment