Anand Hariharan
2004-10-11 17:31:22 UTC
Say I have this really simple code:
<code>
#include <string>
#include <iostream>
int main(void)
{
std::string Name;
std::cout << "Please enter your name: ";
std::getline(std::cin, Name);
std::cout << "Hello " << Name << std::endl;
return 0;
}
</code>
When executing the above compiled code, I have to hit the <Enter> key
TWICE, once after entering my name, and another in a line all by
itself.
Is this a library QoI issue (WinXP, VC6 SP6)
or is there something about getline (or iostreams in general) that I
am not aware of?
thank you & best wishes,
- Anand Hariharan
<code>
#include <string>
#include <iostream>
int main(void)
{
std::string Name;
std::cout << "Please enter your name: ";
std::getline(std::cin, Name);
std::cout << "Hello " << Name << std::endl;
return 0;
}
</code>
When executing the above compiled code, I have to hit the <Enter> key
TWICE, once after entering my name, and another in a line all by
itself.
Is this a library QoI issue (WinXP, VC6 SP6)
or is there something about getline (or iostreams in general) that I
am not aware of?
thank you & best wishes,
- Anand Hariharan