Answers for "input space separated string c++"

C++
7

how to make string get spaces c++

string s;
getline(cin,s);
Posted by: Guest on June-02-2020
1

how to take space separated input in c++

string z,s;
 while (true)
    {
      cin>>z;
      s+=z;
      if(cin.peek()=='n')
      break;
    }
................................
	        OR/
.................................
string s;
getline(cin,s);
Posted by: Guest on July-10-2021

Code answers related to "input space separated string c++"

Browse Popular Code Answers by Language