I am a hobby programmer. I'm asking for help, because I'm wondering if you can call a variable which is equivalent to the input without the code snippet looking like that:
std::string exampleVariable = "Hello";
std::string exampleInput;
std::cin >> exampleInput;
if(exampleInput == "exampleVariable")
std::cout << exampleVariable;
I want to get my code so far to have that structure:
Input(Example)
=>
Output(variable named Example)
Can I get some help here? I'd appreciate it. Thanks.
Aucun commentaire:
Enregistrer un commentaire