Kambic wrote:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string answer;
while (answer != "Y")
{
cout << "Should Kambic be the next EQEmu Developer?" << endl;
cout << "Please type Y for 'Yes' or N for 'No':" << endl;
cin >> answer;
if (answer != "Y")
{
cout << "die irl plz" << endl;
}
}
cout << "you are teh WIN !!!" << endl;
return 0;
}
N -- Oh btw, it will always return the "you are teh WIN !!!" line because you didn't include "return 0;" in your if statement. So i r teh WIN !!!
Of course it will. But not until you answer Y. Until you answer Y to my question, the program loops endlessly. Ahh, my pressssciousss... yesssss.....
__________________
Sojourneying on the Path to Eternity...
If you enter in something like "a b c d e f g" it will read each item individually. You need to either read it all into a buffer at once, or flush the input buffer somehow between prompts.
Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.