If we ignore the possibillity of using a const_cast<> (Don't do it!), you'll have to make a copy of the string and assign that one instead of the original.It ain't pretty, but it works.Code:int validateXMLfile(char *xmlFile_name); int Processor::InsertOrder(const string file) { int error = 0; char* TempString = new char[file.size() + 1]; strcpy(TempString, file.c_str()); error = validateXMLfile(TempString); delete[] TempString; if(error == 1) { cout << "\nERROR VALIDATING file: " << file << endl; return error; } else { cout << "Order VALIDATED against schema OK "<< endl; } }




Reply With Quote