Storing data in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Storing data in C++?

How can I store data even after the program is closed? Say I write a program that asks for a name and saves that name, and displays the name after closing and opening the program, and will continue to display every name you enter. Is that just a text file thing? I'm confused.

9th Dec 2019, 6:40 AM
Daniel Cooper
Daniel Cooper - avatar
2 Answers
+ 3
Perhaps Code Start check for file - if file found - load its data - if the file is not found - get user to enter the data - save the data Code End
9th Dec 2019, 6:50 AM
Manual
Manual - avatar
+ 1
Proper way to make data persistent is to save it in database.
9th Dec 2019, 10:03 AM
Calviղ
Calviղ - avatar