I recently decided to try and learn how to make simple programs.
I found the tutorials on here and started running through them but I am having problems with this part of C++ right now.
I'm trying to figure out how to use a character or a string input from a user to exit a loop. Everything I do to compare two strings ends up with an error of some sort.
I figured I'd start of with a character then try to use a string.
Here is some code, maybe somebody could assist me.
Thanks :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// letter echoer
#include <iostream>
usingnamespace std;
int main ()
{
char Letter;
do {
cout << "Enter a character: (x to exit) ";
cin >> Letter;
cout << "You entered: " << Letter << "\n";
} while (Letter != "x");
return 0;
}