Hi. I wanted to save an array elements to a text file using Microsoft Visual C++. But I cant seem to put the data into the saved file. I have this part of the code to initiate the save as dialog..Pls help.Thanks
void DATADlg::OnSave()
{
CFile f;
char Filter[]= {"DATA Files(*.skg)|*.skg|Text Files(*.txt)|*.txt|"};
CFileDialog Tmp( FALSE, "skg" ,NULL ,OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT ,Filter);
if( Tmp.DoModal() == IDOK )
{
if( f.Open(Tmp.GetFileName(), CFile::modeCreate | CFile::modeWrite==FALSE))
return;
//'this is where I should put the code to save an array of int say Int DATA[5][5]. :confused:
}
else
return;
f.Close();
}