Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <conio.h>
- #include <string>
- using namespace std;
- void main()
- {
- char input;
- int Counter=0;
- int Size;
- string *Names;
- Names = new string[1];
- bool IsRunning = true;
- while(IsRunning) //Main Loop: You dont want the program to close until....
- {
- cout << "What is their name: ";
- cin >> Names[Size - 1];
- for(int i = 0;i < Size;i++)
- {
- cout << "Person " << i+1 << ": " << Names[i]<<endl;
- }
- cout << "Press y to continue";
- cin >> input;
- if(input == 'y')
- {
- string* Temp;
- Temp = new string[Size+1];
- for(int i = 0; i < Size; i++)
- {
- Temp[i] = Names[i];
- }
- Names = Temp;
- Size++;
- }
- if (input != 'y')
- {
- IsRunning = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement