Develop a C++ program to use skipws flags which skips white space on input of three words
/*C++ program to use skipws flags which skips white space on input of three
words
*/
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
string userString, firstWord, secondWord, thirdWord;
cout<<"Enter three words separated by white space: ";
getline(cin, userString);
istringstream iss(userString);
iss>>skipws>>firstWord>>secondWord>>thirdWord;
cout<<firstWord<<secondWord<<thirdWord;
return 0;
}
Comments
Leave a comment