storing filenames in an array

Hello,
I want to create filenames such as Query.student.1.bin and save them in an array.
I have no problem when I don't include a "." between student and number "1" but as I add a "." there my code does not run. ( it does complies but crashes during the run)

string *filename_str;
filename_str =new string[Number_X_Axis];
for(i=0;i<Number_X_Axis;i++)
filename_str[i]="Query."+Table_Name+"."+convertInt(i)+".bin";

I would appreciate any of your comments on this.

Best
PA
Hmm, try using stringstream and convert it that way...

1
2
3
4
5
#include <sstream>

stringstream ss;
ss << "Query." << Table_Name << "." << convertInt(i) << ".bin";
ss >> filename_str[i]; 
Worked! Thanks
Topic archived. No new replies allowed.