0

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();


}

Edited by happygeek: fixed formatting

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by rontab68
0

Thanks for the reply man,will work on this one and post the results thanks again. :D

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.