0
Someone can explain me this code line by line?
int width, height; cin >> width >> height; char **tab = new char*[width]; for (int x = 0; x < width; x++) { tab[x] = new char[height]; }
6 Antworten
+ 6
Width and height are the input using cin. You basically allocate memory for a pointer to a pointer which is a 2d array of size width*height.
+ 6
Because in memory that's how a 2d array is stored.
+ 5
No problem. :)
0
Thanks ;) But why use this double **?
0
Because of the double array?
0
Thank you so much