How do you dynamically allocate a 2D matrix in C++? I have tried based on what I already know:
#include int main(){ int rows; int c
#include int main(){ int rows=4; int cols=4; int **arr; arr = new int*[rows]; for(int i=0;i