As in the subject how create new 2D array in C++? This code below does not work quite well.
int** t = new *int[3];
for(int i = 0; i < 3; i++)
t[i] = new int[5];
You have a *
in the wrong spot. Try:
int **t = new int *[3];
Would vector< vector< int > >
work?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With