Ok, so i'm trying to learn C++ through online tutorials and a little exploration of my own. I thought it might be neat to make a contact book that stores (only while it runs) names and phone numbers and then prints it out and the end of the program. I know I need a 2d array for that to work but I want to let the user decide how many names they want to input. I've looked it up and everywhere I go its "Use a vector because X" and right below this guy is "No vectors are terrible, use a dynamic array" and the arguments don't cease. So can someone show me what I really need to use and why. I just want to know how to have a dynamic 2d array so I can learn it and move on. Thanks for your time.
PS. Yes the loops looks horrid and I will tidy everything up after I get this.
#include "stdafx.h"
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
int test;
int arraySize = 1;
int counter;
string cont = "";
string name = "";
string number = "";
cout << "How big should the contact book be?\n"; //I want the user to choose the size for the contact book/array.
cin >> arraySize;
//Need a 2d Array
cout << "\nDo you want to enter names into the book?";
cin >> cont;
while (cont != "n")
{
cout << "What is the name you want to enter?\n";
cin >> name;
cout << "What number do you want to associate with this name?\n";
cin >> number;
cout << "Do you want to continue?\n";
cin >> cont;
}
//Would like to print array here
return 0;
}