I went through lot of the resources on web but still not able to get this. I didn't understand how std::skipws works to ignore whitespaces , tabs and newlines.
Following is my simple code
vector<string> vec;
while(1){
getline(cin, s);
if( s.compare("#") == 0)
break;
else
vec.push_back(s);
}
I will enter a line of strings with newlines, whitespaces and tabs. After input I want to store strings into the vector and that will stop when "#" string is encountered. I tried with the above code but it store spaces along with the strings in the vector though it terminates after enterting "#".