How can I make a dynamic 2d array?

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.

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
47
48
49
50
51
52
53
  
#include "stdafx.h"
#include <iostream>
#include <string>


using namespace 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;
}


Topic archived. No new replies allowed.