I know I can allocate an array dynamically like this:

Code: Select all

```
#include <iostream>
int * array;
int main(){
int n;
cin >> n;
array = new int[n];
//~ Use the array here...
delete [] array;
return 0;
}
```

**matrix of size n*n**in a similar fashion? That is, I don't know how big the matrix will be until runtime and need to read the size.

I'd appreciate your help. Thanks in advance.