For some reason, this very simple code doesn't read in the very first character...
CODE
char strScenario[80] = {0};
cout << "Enter name of scenario" -->;
gets(strScenario);
if I type in "scenario01" in the console window, the data inside strScenario after this code is "cenario01", it's missing the first character. I've tried many different variations of this code, such as...
CODE
char strScenario[80] = {0};
cout << "Enter name of scenario" -->;
cin.getline(strScenario, 80);
CODE
char strScenario[80] = {0};
cout << "Enter name of scenario" -->;
cout.flush();
cin.getline(strScenario, 80);
and they all produce the same results, the first character is missing. Why?!?
and when i do this...
CODE
char strScenario[80] = {0};
cout << "Enter name of scenario" -->;
cin >> strScenario;
i get "ar" as the data.
any ideas? Thanks in advance!
Beeeph