codice:
#include <fstream>
int main()
{
char* filename = "test-out.txt";
ofstream fout ( filename );
if ( ! fout ) { cerr << " can't open input - " << filename <<
endl; return 1; }
fout << quì metti quello che vuoi << endl;
fout fout.close();

return 0;
}