How to develop a software in c++? i know it should be done through a program. But how can i develop it into a software which runs like the dos counter-part of eclipse or media player or any other software. I mean how can I make the program to remember the values the user assigned to its variables without erasing it every time I close the .exe
file running the program? Hope you understand my question.

- 9
- 2
-
i am looking for a metod without using file handling operations.... – Arun Kishorre S Jul 03 '13 at 20:04
-
@ArunKishorreS As noted and _linked_ in my answer you can use registry functions if you're on Windows. It just depends on how much data you need to persist between sessions. – Captain Obvlious Jul 03 '13 at 20:08
-
@ArunKishorreS Why? (it doesn't hurt, really. try it.) And how? Everything that achieves this uses files (databases, registry on Windows, the User Defaults on Mac, etc.) - the only exception I can think of is using environment variables, but that's limited to short strings and extremely fragile and insecure and conceptually wrong too. – Jul 03 '13 at 20:12
3 Answers
You should store that value outside, in example in XML, JSON, SQLITE. The keyword for today is Database.
The simple example is QT with SQLITE or even simpler reading/writing to file. Here is a basic tutorial aka reference.
Here is the usage of rapidxml (pretty fast)
How to develop a software in c++?
Well the simplest way to get into process is to track some open software applications. There is a lot of tasks marked as Junior Job. Try to implement it.

- 2,783
- 1
- 21
- 31
-
can we use databases such as SQLITE with c and c++?? i am developing a software in c++... – Arun Kishorre S Jul 03 '13 at 19:54
-
1@ArunKishorreS You didn't bother reading the docs for SQLite, did you? It **is** a C API (possibly with bindigs to other languages). – Jul 03 '13 at 20:14
How to develop a software in c++?
I suggest picking up a good book on C++ and do all included exercises. If you don't understand a particular portion of the language or standard library refer to cppreference.com and StackOverflow. Both have search facilities.
I'm sure there are plenty of tutorials available on the web but I cannot personally recommend any for beginners.
I mean how can I make the program to remember the values the user assigned to its variables
The easiest way without using any third party libraries or OS specific API's is to use std::ifstream
and std::ofstream
.
Since it appears you are developing for Windows platforms (.exe
mentioned) I suggest you also take a look at the registry functions available in the Windows API.

- 1
- 1

- 19,754
- 5
- 44
- 74
Here is a link which guides one for writing data to a file.
http://www.cplusplus.com/doc/tutorial/files/
If you want to use this data the next time you execute the program, maybe you want to incorporate an if statement that says if the file exists and is not empty, then import the data from there into your program (which means adding lines to your program to also read in the data from the file).

- 205
- 2
- 8