I'm trying to make a name database in the console. I would like the names typed to be displayed as a list underneath the first and last name question.
I've looped the program using do while loop, and now am trying to get the names to display....I would like the names to appear bellow, and would also like to avoid, the loop pushing my program down the page. Can it be reinitialized or reset to start over while displaying the names bellow?
//This is my database of nammes
//Get information from user
cout << "What is your first name?" <<endl;
cout << "What is your last name?" <<endl;
} while (true);
string firstn, lastn;
cout << lastn; cout<< ", " << firstn <<endl;
Output desired below prompts:
1. Last, First1
2. Last First2
3.Last First 3
additionally, is there a way to make these names stay in it permanently? So as when I open the program every time, the input from previous users is still there?
Any help would be appreciated!
Pretty new to this.