dynamically generating 2d array in cpp
int** a = new int*[rowCount];
for(int i = 0; i < rowCount; ++i)
a[i] = new int[colCount];
dynamically generating 2d array in cpp
int** a = new int*[rowCount];
for(int i = 0; i < rowCount; ++i)
a[i] = new int[colCount];
declaring 2d dynamic array c++
int** arr = new int*[10]; // Number of Students
int i=0, j;
for (i; i<10; i++)
arr[i] = new int[5]; // Number of Courses
/*In line[1], you're creating an array which can store the addresses
of 10 arrays. In line[4], you're allocating memories for the
array addresses you've stored in the array 'arr'. So it comes out
to be a 10 x 5 array. */
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us