I would like to allocate this array dynamically in C ++:
int main()
{
int n,m;
cin>>n>>m;
if(n>m){cedula tabela[n][n];}
else {cedula tabela[m][m];} return 0;}
But the code does not compile, I think it has to do with dynamic allocation, I tried to do the following:
int main()
{
int n,m;
cin>>n>>m;
if(n>m){cedula* tabela= new cedula[n][n];}
else {cedula* tabela = new cedula[m][m];} return 0;}
But it did not compile anyway.