You need to put your code in an int main() function. After that, you need some code. I suggest using an ofstream object. You can also use the "flush" command to save.
Example:
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
int main()
{
ofstream fout("myfile.txt"); //Opens myfile.txt
fout << "some text" << endl; //Outputs something to the file
fout.flush(); // Writes to the file (saving)
fout.close(); // Closes the file
return 0;
}
Normally fout.close() should be all that you need, but flushing helps in some situations. I don't know what your code looks like but it could be one of those situations.