double asterisk array in c++, computer science homework help

User Generated

whircnffvba

Computer Science

Description

I have class A and B is a derived class.

I want to make a data structure to manage the objects.

I choose an array. Array's definition is A **m_A . I'll use double asterisk.

I allocate an object. A *ptrA = new A.

I want this to be in the first element of the array.

I tried :

A *ptrA = new A;

A **m_A[3];

**m_A[0] = ptrA;

It didn't work. Can any one help me with this please?

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, how are you doing.to answer your question:first what you are trying to do will crash the c++ compiler.why?first you should...


Anonymous
I use Studypool every time I need help studying, and it never disappoints.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Related Tags