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
#include <iostream>
#include "conio.h"
#include <string>
#include <sstream>
#include <list>
usingnamespace std;
class table;
string firstn;
string lastn;
//Get information from user
int main()
{
do
{
cout << "What is your first name?" <<endl;
cin >>firstn;
cout << "What is your last name?" <<endl;
cin>>lastn;
} while (true);
{
public;
string firstn, lastn;
cout << lastn; cout<< ", " << firstn <<endl;
system ("PAUSE");
}
Output desired below prompts:
1. Last, First1
2. Last First2
3.Last First 3
4. etc....
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.