I'm using the following code to use an int variable (hard coded here but normally cinned by a user) as the beginning of a filename, this code should work, but i think i may be messing up my steps, i get the error: 'can not turn char* to int' when i try to compile, here's the code...anyone know whats wrong??
thanks for your helpCode:int studentID="04390" template <class T> std::string toString(const T& val) { std::ostringstream strWriter; strWriter << val; return strWriter.str(); } int main() { std::string filename=toString<int>(studentID) + ".xml"; std::ofstream file (filename.c_str()); //etc. return 0; }