#include<sstream> string str = "hello world"; stringstream ss(str); string temp; while(ss >> temp) { cout<<temp<<endl; }
string str = "hello world"; cout<<str.substr(0,2)<<endl;