lets say I have a class named MyClass, and a variable named val, what does the following statement mean? i know its dynamic allocation, but what does the ** indicate?


MyClass **p1 = new MyClass*[val];

thanks for your help.

Recommended Answers

All 2 Replies

lets say I have a class named MyClass, and a variable named val, what does the following statement mean? i know its dynamic allocation, but what does the ** indicate?


MyClass **p1 = new MyClass*[val];

thanks for your help.

* is a pointer. ** is a pointer to a pointer. So p1 is an array of pointers to variables of type MyClass.

thank you so much. the rest of the code makes sense now :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.