c++: pointers to pointers

A

A

Hi,

I have an array of pointers defined as such:

myArray** ptr = new myArray[10];

for some reason i get a compile time error stating there is no default
constructor for myArray. The problem is that i should not need to define one
since myArray is a pointer to a pointer and so should not have a default
constructor - its a primitive data type and not an object.

Any help appreciated.

Regards,
A
 
R

Rob Williscroft

A wrote in
Hi,

I have an array of pointers defined as such:

myArray** ptr = new myArray[10];

myArray** ptr = new myArray *[10];
for some reason i get a compile time error stating there is no default
constructor for myArray. The problem is that i should not need to
define one since myArray is a pointer to a pointer and so should not
have a default constructor - its a primitive data type and not an
object.

HTH.

Rob.
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top