storing variables permanentely

This is a discussion on storing variables permanentely within the C++ Programming forums, part of the General Programming Boards category; how does one store a number or a character permanently in c++ .
for ex
the program asks you for ...

Like anon said, write it to a file. I write my variables (or option choices) to .ini files and use the GetPrivateProfileString/Int functions (declared in windows.h) to get them every time the program starts.

If you want something more portable than what scwizzo uses, you can either write code to parse your own file format, use a portable library that parses an existing file format, or use a database management system. All these are fundamentally variants of the same theme of writing to file.

If you happen to be on a mainframe, you can write the data to CSA memory. Other OS's have shared memory, but I think one program would always need to be running to keep the shared memory handle open.
But obviously a reboot would lose the data in these cases. Saving to a file is the only way for data to survive a reboot.

Then every time a person runs your program the program sends you an email, when you get the email you check the rock for what the value is and reply to the email with that value. Should be the same value everytime.

can an novice like me understand it or what should i do understand it?

Writing to a file is easy (you can use << just like writing to the screen -- google for ofstream and ifstream). The other point we're trying to get you to think about is deciding what you want to write to the file; ain't nobody gonna be able to do that but you. Do you need a bunch of stuff? Do you always want to have the same data, or are some things optional? The more flexible your data file is, the more complicated your program is going to get.