I can use the following code to write the content of a string to a file,
ofstream outfile;
outfile.open("xyz.txt");
outfile<<strng1<<endl;
but what should I do to write content of different strings to different files. Multiple use of outfile is creating errors.