Allocate an array of pointer

  • Thread starter Thread starter Hai Ly Hoang
  • Start date Start date
H

Hai Ly Hoang

Hi,
I try to allocate an array of pointer with this pieces of code:
int **a;
a = new (int *)[3];
but the compiler report that : missing ; before [.
It's may be an easy question. However, how to cope with the message ?

Thanks for your attention.
 
I try to allocate an array of pointer with this pieces of code:
int **a;
a = new (int *)[3];
but the compiler report that : missing ; before [.

Try:

a = new int * [3];

Dave
 
Back
Top