Hello,
I am trying to make a function where I can input a filename and a string for insertion into a file.
Can anyone tell me what is wrong with this? It gives me an error on the 3rd and 4th lines when I try to compile.Code:void write(string filename, string text)
{
ofstream file;
file.open(filename);
file << text;
file.close();
return;
}
Thanks,