I take in a line of text at a time from a file, do my parsing and organizing, append it all to my big finale' string and do the funky chicken, then my data is ready to be written to a file.
Everything is dandy for me up until I get to actually writting the string. I created a simplified variation of my sample code which still produces the error, then I cut it down to this to show who ever may help me. Here it is:
Code:
string name, pass, final; // all strings
[ ... blabla .. ]
final.append("INSERT INTO `data` VALUES (1, '");
final.append(name);
final.append("', '");
final.append(pass);
final.append("');");
fout.write(final.c_str()); // <---- Fails Here
fout.put('\n');
Essentially it doesn't want a const char* and it's getting one... so how exactly do I go about getting my string from this state in to my file?
I attempted to creat a char* which pointed to the string.c_str() and casted which failed, I then realized I was guessing and who know where I would go after that so someone please help.
Thanks!