Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,132 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,798 people online right now. Registration is fast and FREE... Join Now!




Making programs remember something

 
Reply to this topicStart new topic

Making programs remember something

Pontus
14 May, 2007 - 10:26 AM
Post #1

Dreaming Coder / Coding Dreamer
Group Icon

Joined: 28 Dec, 2006
Posts: 529



Thanked: 2 times
Dream Kudos: 275
My Contributions
How can i make a program somethinh without the use of files or the registry?I mean IN the exe itself
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Making Programs Remember Something
14 May, 2007 - 10:37 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
Can you specify what you're referring to? Generally speaking, to have information available to the 'program' by which I mean one instance of the program, that information has to be saved somewhere, either in a database, file, or some other method.

What information is it that you would like the program to have access to, to have saved between program runs?
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Making Programs Remember Something
15 May, 2007 - 05:17 AM
Post #3

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 523



Thanked: 3 times
Dream Kudos: 125
My Contributions
Some knowledge of how your favorite operating system does things would be nice.
In short:
- the user choses to start a program.
- the OS reserves some ram, loads the program from disc into ram, and starts the program.
- the program runs, possibly allocating more ram and doing things with it, doing system calls to do IO, graphics, etc.
- the program ends, the OS cleans up the memory and releases it for recycling.

Now, if you want data in that program to be persistent, there are only 2 ways.
1: you never terminate the program
2: you write the data on a persistent place (a file, database or the registry) and read it each time the program starts, and re-write it if it changes.
User is offlineProfile CardPM
+Quote Post

Pontus
RE: Making Programs Remember Something
15 May, 2007 - 09:28 AM
Post #4

Dreaming Coder / Coding Dreamer
Group Icon

Joined: 28 Dec, 2006
Posts: 529



Thanked: 2 times
Dream Kudos: 275
My Contributions
But how do they make those install files then?
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Making Programs Remember Something
15 May, 2007 - 10:31 AM
Post #5

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
If you are referring to the process by which applications are installed, these are usually created as executable files that are small programs in themselves.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:26PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month