C++ computer memory access

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

Join Date: Apr 2008
Posts: 4
Reputation: sohamghosh is an unknown quantity at this point 
Solved Threads: 0
sohamghosh sohamghosh is offline Offline
Newbie Poster

C++ computer memory access

 
0
  #1
Oct 19th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 675
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 100
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

Re: C++ computer memory access

 
0
  #2
Oct 19th, 2008
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.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: C++ computer memory access

 
0
  #3
Oct 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 206
Reputation: grumpier has a spectacular aura about grumpier has a spectacular aura about 
Solved Threads: 31
grumpier grumpier is offline Offline
Posting Whiz in Training

Re: C++ computer memory access

 
0
  #4
Oct 19th, 2008
Originally Posted by Alex Edwards View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: C++ computer memory access

 
0
  #5
Oct 19th, 2008
Originally Posted by grumpier View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 114
Reputation: sidatra79 is an unknown quantity at this point 
Solved Threads: 8
sidatra79's Avatar
sidatra79 sidatra79 is offline Offline
Junior Poster

Re: C++ computer memory access

 
0
  #6
Oct 19th, 2008
Hi
like sbdy told u above search for

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

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....
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC