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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top