vector of strings instead of cout?

Hi,
I have the following code and i need to direct its 1154 outputes to a vector of strings as i need to use this vector later on?
any idea how to do it?
thanks
hash mobtadi

#include <iostream>
#include<iomanip>
#include <string>
#include <sstream>
using std::string;
using namespace std;

int main (){
for (int i=0; i< 10; i++){

for (int j=0; j< 10; j++){

for (int t=0; t< 10; t++){

for (int l=0; l< 10; l++){

if ( (i*1000+ j*100 + t*10 + l) > 1154) break;



cout<<"M0"<<i<<j<<t<<l<<endl;
}
}
}
}
system("pause");
return 0;
}
1
2
3
4
5
  {
  stringstream ss;
  ss << "MO" << i << j << t << l << endl;
  myvec.push_back( ss.str() );
  }

Hope this helps.
Thanks Duoas,
I have done almost similar thing, but it doesnt like it and says

"1>d:\main data folder\drosophila_project\myod-for-georgy\myod\myod\common-binding-sites.cpp(24) : error C2039: 'push_back' : is not a member of 'std::basic_ostringstream<_Elem,_Traits,_Alloc>'"

#include <iostream>
#include<iomanip>
#include <string>
#include <sstream>
#include <vector>
using std::string;
using std::ostringstream;
using namespace std;

int main (){
ostringstream outputString;
vector<string> motifs ;
for (int i=0; i< 10; i++){

for (int j=0; j< 10; j++){

for (int t=0; t< 10; t++){

for (int l=0; l< 10; l++){

if ( (i*1000+ j*100 + t*10 + l) > 1154) break;

outputString<<"M0"<<i<<j<<t<<l<<endl;
outputString.push_back(outputString());

}
}
}
}
cout<<outputString.str();


// system("pause");
return 0;
}


{
stringstream ss;
ss << "MO" << i << j << t << l << endl;
myvec.push_back( ss.str() );
}

Thanks Duoas ,
it works
Topic archived. No new replies allowed.