Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how can i declare a C++ array of 10 pointers to objects of a class?

Assume a circle class has been implemented. how can I declare an array of 10 pointers to objects of the circle class?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

how can I declare an array of 10 pointers to objects of the circle class?

Like this:

circle* myArray[10];

It is then your responsibility to assign those pointers to point at valid circle objects. But how you do that exactly is outside the scope of your question, as you did not explain how you intend to use the circle class or this array.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading