Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question 9 What is wrong about the class constructor below? class My Class { private: int *ptr: public: MyClass() { ptr = new int

C++ image text in transcribed
Question 9 What is wrong about the class constructor below? class My Class { private: int *ptr: public: MyClass() { ptr = new int [2]; ptr[1]= 300; ptr[3] = 999; }; ptr[O] must be the first element. Optr[3] does not exist; it is out of bound of the array. Optr[1] = 300; is not a legal statement. a and b are correct answers. O a and care correct answers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

Students also viewed these Databases questions

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago