943,733 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1483
  • C++ RSS
Oct 19th, 2008
0

C++ computer memory access

Expand Post »
I am trying to make a bank C++ program but the problem is that when the program terminates, data is lost and when I start it again, it reinitializes. Can someone tell me how to save the information in my harddrive and not my RAM?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sohamghosh is offline Offline
4 posts
since Apr 2008
Oct 19th, 2008
0

Re: C++ computer memory access

Well You should use files to store data and get back data in the beggining stages.

filestreams would help you out with that.

Try googling out filestreams with c++ for a tutorial.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Oct 19th, 2008
0

Re: C++ computer memory access

There are several ways...

The most popular way would be to save the information to a file then retrieve it later.

Another popular way that isn't done unless absolutely necessary is by querying information to a database then retrieving it later.

There may be a way to fool around with memory and store the information somewhere more permanent, but I don't know how to do that, nor would I recommend it.
Last edited by Alex Edwards; Oct 19th, 2008 at 1:36 am.
Reputation Points: 392
Solved Threads: 108
Posting Shark
Alex Edwards is offline Offline
971 posts
since Jun 2008
Oct 19th, 2008
0

Re: C++ computer memory access

There may be a way to fool around with memory and store the information somewhere more permanent, but I don't know how to do that, nor would I recommend it.
Yeah, it's usually called "copying contents of memory to a disk file in some format" :lol:

There are some types of memory more enduring than RAM (eg ROM) but using them relies on them being present (i.e. not guaranteed to be available for use on all computers) and also relies on significantly more knowledge than saving data to a disk file.
Reputation Points: 193
Solved Threads: 32
Posting Whiz in Training
grumpier is offline Offline
206 posts
since Aug 2008
Oct 19th, 2008
0

Re: C++ computer memory access

Click to Expand / Collapse  Quote originally posted by grumpier ...
Yeah, it's usually called "copying contents of memory to a disk file in some format" :lol:

There are some types of memory more enduring than RAM (eg ROM) but using them relies on them being present (i.e. not guaranteed to be available for use on all computers) and also relies on significantly more knowledge than saving data to a disk file.
Yes that's pretty much the point I was getting at, besides the other 2 more reliable (and safer) ways I've already mentioned.
Reputation Points: 392
Solved Threads: 108
Posting Shark
Alex Edwards is offline Offline
971 posts
since Jun 2008
Oct 19th, 2008
0

Re: C++ computer memory access

Hi
like sbdy told u above search for

Quote ...
filestreams
but when u start searching for tutorials add the following term as well:

Quote ...
serialization
A hard disk and thus a disk file too has a one-dimensional structure -> linear.
Therefore whenever you write to a file, you write one thing after another--serially.
Hence the name serialization. The opposite is called deserialization.

Finally u might find helpful the following thread which is also about a bank account program and uses serialization:
http://www.daniweb.com/forums/thread151845-2.html

I am starting to suspect that u and Avaviel might be classmates....
Reputation Points: 46
Solved Threads: 8
Junior Poster
sidatra79 is offline Offline
114 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Writing a Program using "pass-by-reference" functions.
Next Thread in C++ Forum Timeline: C++ Midterm Help Please!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC