save ARRay elements to a file

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2006
Posts: 13
Reputation: rontab68 is an unknown quantity at this point 
Solved Threads: 0
rontab68 rontab68 is offline Offline
Newbie Poster

save ARRay elements to a file

 
0
  #1
Mar 16th, 2006
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].




}
else
return;

f.Close();

}
Last edited by rontab68; Mar 16th, 2006 at 8:47 am. Reason: omitted words
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: save ARRay elements to a file

 
0
  #2
Mar 16th, 2006
What about using CFile::Write() ??? Have you tried it?
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 13
Reputation: rontab68 is an unknown quantity at this point 
Solved Threads: 0
rontab68 rontab68 is offline Offline
Newbie Poster

Re: save ARRay elements to a file

 
0
  #3
Mar 17th, 2006
Thanks for the reply man,will work on this one and post the results thanks again.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC