I'm trying to create a loop that creates csv files.
It's quite simple, however fileout.open() or ofstream fileout () gives me an error when i tired to put a string inside the parameter.
I tired both ways and they both doesn't work.
Code:
int x = 5;
//loop stuff to get x
int x = 5;
std::string s;
std::stringstream out;
out << x;
s = out.str();
s += ".csv";
ofstream onFile (s);
Code:
int x = 5;
//loop stuff to get x
std::string s;
std::stringstream out;
out << x;
s = out.str();
s += ".csv";
ofstream fileout ;
fileout.open (s) ;
If you could help me, it would be nice. Thanks