Asked by Bill
double **dptr;
dptr = new double*[5];
for (int i = 0; i < 5; i++)
dptr[i] = new double[3];
How many rows and columns will there be in dptr? Also, what would the code look like to Delete all the space allocated for dptr???
dptr = new double*[5];
for (int i = 0; i < 5; i++)
dptr[i] = new double[3];
How many rows and columns will there be in dptr? Also, what would the code look like to Delete all the space allocated for dptr???
Answers
Answered by
MathMate
dptr = new double*[5];
// creates 5 rows
for (int i = 0; i < 5; i++)
dptr[i] = new double[3];
// creates 5 columns for each row.
// use the free() function to release memory
// creates 5 rows
for (int i = 0; i < 5; i++)
dptr[i] = new double[3];
// creates 5 columns for each row.
// use the free() function to release memory
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.