Problem with dynamic memory

This program hasn't been done yet. I don't know what should I do. Here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <cstdlib>

using namespace std;

double** Cr_Arr();

int nr, nc;

int main()
{


    return 0;
}

double** Cr_Arr();
{
    double **pmat;
    cout<<"Matrix dimensions - ";
    cin>>nc>>nr;
    pmat=new (double*)nr; 
    if(!pamt)
        return NULL;
}


The compiler has writen:
Error: can't convert 'double**' to 'double*' in assignment
Error: expected ';' before 'nr'
Shall be

pmat = new double * [nr];
Thanks it helped
Topic archived. No new replies allowed.