What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Saveing in C++

Saveing in C++
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Saveing in C++
quote:
Originally posted by DJeX
Sorry Choli, I'm just starting out with C++. How would I dump the class attributes to a file?
the basic idea is that you create a metod that when called if saves all the variables to the file and another one for reading the file and setting the variables with the proper value. If you're new with C/C++, you should get used to manage files (open, close, read, write, .... them).

IMO, you have to ask yourself several questions: do you really want to save the exact status of your program or you only want to save the user settings? Think a bit about that, it's not the same and probably you do not want the first thing * (which is like pausing the execution of the program and resuming it later; quite complex because it envolves more things than just saving and loading all the status and settings)

As a summary of what Cookie said, and saying like a "geleral rule", you should use the registry to store the user settings of the program, ie: how the program behaves; and save into a file (or files) the data that the program manages: what the programs works with (user's data, documments, etc...).


*-> in case you want to save the whole status of your program: ask yourself: what differences the program in two instants of time? what may change from one moment to the next one? All that has to be measured and forms the status of the program. If you dessign the program well, all that will be in (and will be formed by) all the variables and classes of your program together with the current task that the program is doing, which should be doing nothing, because at the point where you save the status your program shouldn't be doing anything else.

--------

I know all this may seem quite complex to understand, because you're new at c++. Don't worry. First of all get used to the language and then start doing more complex things.

Let me suggest you a book: "Thinking in C++". It's a book made of 2 volumes and you can freely download from the internet (google it). I haven't read the whole book, but it seems a quite good book.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
01-03-2005 08:51 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Saveing in C++ - by DJeX on 01-02-2005 at 09:34 PM
RE: Saveing in C++ - by RaceProUK on 01-02-2005 at 10:18 PM
RE: Saveing in C++ - by DJeX on 01-02-2005 at 10:59 PM
RE: Saveing in C++ - by Choli on 01-02-2005 at 11:08 PM
RE: Saveing in C++ - by DJeX on 01-03-2005 at 01:58 AM
RE: Saveing in C++ - by CookieRevised on 01-03-2005 at 02:58 AM
RE: Saveing in C++ - by Choli on 01-03-2005 at 08:51 PM
RE: Saveing in C++ - by DJeX on 01-03-2005 at 09:37 PM
RE: Saveing in C++ - by TheBlasphemer on 01-03-2005 at 09:51 PM
RE: Saveing in C++ - by DJeX on 01-03-2005 at 10:26 PM
RE: Saveing in C++ - by Choli on 01-03-2005 at 10:27 PM
RE: Saveing in C++ - by CookieRevised on 01-03-2005 at 11:11 PM
RE: Saveing in C++ - by Choli on 01-03-2005 at 11:39 PM
RE: Saveing in C++ - by DJeX on 01-04-2005 at 01:07 AM
RE: Saveing in C++ - by RaceProUK on 01-04-2005 at 05:56 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On