For example, I have 3 variables: int a = 3 - int b = 32 - int c = 25;
First I write/save in a txt file; after, in other moment, I open, read and load this variables to my application.
I'm looking for a simple example, tips or where can I search this topic, please....
I'm using this codes to save and open.
OPEN:
Code: Select all
wxFileDialog
openFileDialog(this, _("Open TXT file"), "", "",
"TXT files (*.txt)|*.txt", wxFD_OPEN|wxFD_FILE_MUST_EXIST);
if (openFileDialog.ShowModal() == wxID_CANCEL)
return; // the user changed idea...
wxFileInputStream input_stream(openFileDialog.GetPath());
Code: Select all
wxFileDialog
saveFileDialog(this, _("Salvar TXT file"), "", "",
"TXT files (*.txt)|*.txt", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (saveFileDialog.ShowModal() == wxID_CANCEL)
return; // the user changed idea...
wxFileOutputStream output_stream(saveFileDialog.GetPath());