This is a simple sample code of how to create and write a file. Sometimes this is really trivial but when u switch languages all the time, we tend to forget a bit the syntax ^__^

[source:c++]

//Open/Write File
CStdioFile Outputfile;
CFileException FileExc;
UINT nOpenFlags;

//Creates the File with the Date/Time
COleDateTime::GetCurrentTime();
COleDateTime odt = COleDateTime::GetCurrentTime();
//Date/Time Format
CString str1 = odt.Format(”%B_%d_%Y_%H_%M_%S” );
szFileName =”LogFile_” + str1+ “.txt” ;

nOpenFlags = CFile::modeWrite | CFile::modeCreate;
//If any errors @ opening file. displays msg.
if (!Outputfile.Open( (”GPSLog_” + str1+ “.txt”), nOpenFlags, &FileExc)) {
FileExc.ReportError();
return;
}
//Writes in the file
Outputfile.WriteString(”WRITE W/E TEXT HERE”+’\n’);
//closes it
Outputfile.Close(); [/source]

Stumble it!