Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. #include <conio.h>
  4. #include <string>
  5. using namespace std;
  6.  
  7. void main()
  8. {
  9.     char input;
  10.     int Counter=0;
  11.     int Size;
  12.  
  13.     string *Names;
  14.     Names = new string[1];
  15.  
  16.     bool IsRunning = true;
  17.  
  18.     while(IsRunning)    //Main Loop: You dont want the program to close until....
  19.     {
  20.  
  21.         cout << "What is their name: ";
  22.         cin >> Names[Size - 1];
  23.  
  24.  
  25.         for(int i = 0;i < Size;i++)
  26.         {
  27.             cout << "Person " << i+1 << ": " << Names[i]<<endl;
  28.         }
  29.  
  30.  
  31.         cout << "Press y to continue";
  32.         cin >> input;
  33.  
  34.  
  35.         if(input == 'y')
  36.         {
  37.             string* Temp;              
  38.             Temp = new string[Size+1];
  39.  
  40.             for(int i = 0; i < Size; i++)
  41.             {
  42.                 Temp[i] = Names[i];
  43.             }
  44.             Names = Temp;
  45.             Size++;
  46.         }
  47.  
  48.         if (input != 'y')
  49.         {
  50.             IsRunning = false;
  51.         }
  52.  
  53.  
  54.  
  55.  
  56.     }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement