Output Question

Hey everyone,

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?

here is the code I got up to now.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//This is my database of nammes
#include <iostream>
#include "conio.h"
#include <string>
#include <sstream>
#include <list>

using namespace 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.

Thank you!!!
Bikedude1989
additionally, is there a way to make these names stay in it permanently?

write them to a file and have the program update the file
Topic archived. No new replies allowed.