Skip to content

Instantly share code, notes, and snippets.

@tanvir002700
Created July 1, 2016 21:22
Show Gist options
  • Save tanvir002700/abfe77faae1f1c8e3551d646606626b0 to your computer and use it in GitHub Desktop.
Save tanvir002700/abfe77faae1f1c8e3551d646606626b0 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
int main()
{
string s1="This is example of String Stream";
stringstream Stream1(s1);
string token;
while(Stream1>>token)
{
cout<<token<<" ";
}
cout<<endl;
string s2="1 2 3 4 5 16 90 100 -199";
stringstream Stream2(s2);
int t;
while(Stream2>>t)
{
cout<<t<<" ";
}
cout<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment