I'm trying to write to output files that have dynamically created names. I can do this (I think) by using an ostringstream variable, but the file variable expects a pointer to a constant char. How do I convert this ostringstream variable (called 'result' here) to a pointer to a constant char? 'r' is an integer here. I tried converting the ostringstream variable to a string variable, but the ofstream variable won't accept that either. This is the few lines of code that are important:
Code:result << "testfiles_" << r; std::string bufoutput_s = result.str(); ofstream outputfile (bufoutput_s);