| | |
save ARRay elements to a file
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2006
Posts: 13
Reputation:
Solved Threads: 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].
}
else
return;
f.Close();
}
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
![]() |
Similar Threads
- problem in running perl script (Perl)
- Trying to creating an array from a text file (C++)
- Help with a 2D array from a text file (C++)
- How to load a JPEG image file, store it in array and then save it (Visual Basic 4 / 5 / 6)
- Getting an array from a txt file (C)
- reading txt file into array (C++)
Other Threads in the C++ Forum
- Previous Thread: Creating dynamic array structures
- Next Thread: Projects in C++
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count database delete desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






