Hi there. Right now I am trying to make a text based adventure, but I do not know how to register input. Most of my somewhat basic skill relates to mathematics, loops, etc. and other more used things in C++. But right now I need to register input from a keyboard.
Since this is a text-based adventure, getline(cin, MyString); would probably be a better choice since it allows you to stream input with spaces and discards that extra newline character.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
int main(int argc, char **argv){
MagicInitializer();
std::string User_Input = "";
bool keep_playing = true;
std::cout << "Welcome to my magical game.\n";
do{
std::cout << "Now what?" << std::endl;
std::getline(std::cin, User_Input);
//Super amazing function that determines output and modifies
//keep_playing via reference.
Magical_Input_Processor(User_Input, keep_playing);
}while(keep_playing);
Destroy_Magical_Traces();
return 0;
}