| | |
How do I create a program that creates a file that stores the variables data?
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
I'm having a problem on how to create a program on c++ that creates its own file and storage capabilities. I'm planning to have an interface like this so I put a little detail about the program just to give you the idea of what I actually mean... it goes like this...
Menu
1. Create Profile
2. Search Listed Profiles
3. Search Details
4. Exit
That is a simple interface but what drives me crazy is on how to save the data that was stored in the variables. I've already used array technique but every time I shut the program, I could never access those data again if I choose the #2 option which is the "Search Listed Profiles" and #3 option which is the "Search Details". Is there anyway that I could do just to make that program work the way that I want it to be? I mean, the capabilities of such program that I'm dreaming of. I'm trying to copy the capabilities of a Database software.
Menu
1. Create Profile
2. Search Listed Profiles
3. Search Details
4. Exit
That is a simple interface but what drives me crazy is on how to save the data that was stored in the variables. I've already used array technique but every time I shut the program, I could never access those data again if I choose the #2 option which is the "Search Listed Profiles" and #3 option which is the "Search Details". Is there anyway that I could do just to make that program work the way that I want it to be? I mean, the capabilities of such program that I'm dreaming of. I'm trying to copy the capabilities of a Database software.
Re: How do I create a program that creates a file that stores the variables data?
0
#2 Dec 7th, 2008
For this you will need to open file in append mode. this way you will be able to read the data in the file as well as add new data at the end.
Also see this page: File Operations using fopen
C++ Syntax (Toggle Plain Text)
fopen("fileName", "a");
Also see this page: File Operations using fopen
Live free.... Die Hard!
Re: How do I create a program that creates a file that stores the variables data?
0
#3 Dec 7th, 2008
In c++ you could use the fstream functions
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Re: How do I create a program that creates a file that stores the variables data?
0
#4 Jan 4th, 2009
![]() |
Similar Threads
- tracking grades (Java)
- Record Files (Pascal and Delphi)
- Can Someone please check my project & comment/tips (C)
Other Threads in the C++ Forum
- Previous Thread: Help with what should be a very simple code task.
- Next Thread: How do we start making games?
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






