How we can input single string with free space.
for example
string a;
cin>>a; (ali asad)
now it ignores asad and just takes ali. how to slove this issue.
please please help.
How we can input single string with free space.
for example
string a;
cin>>a; (ali asad)
now it ignores asad and just takes ali. how to slove this issue.
please please help.
Use the version of std::getline() for std::string.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Please give a short example
I certainly could:
You might want to read cppreference.com's entry on getline.Code:string a; getline(cin, a, '\n');
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)