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.:?:

Recommended Answers

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.

fopen("fileName", "a");

Also see this page:

Jump to Post

All 3 Replies

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.

fopen("fileName", "a");

Also see this page: File Operations using fopen

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.