Question & Answer: Given the declarations double x: double* ptr = &x: What does the following statement do? *ptr = 24.9: A) It stores 24.9 into ptr…..

e after it is declared are used to retrieve el of a vector bject can be created with an initial size. A vector can store only data of type int. 30. Given the declarations double x double* ptr = &x ; what does the following statement do? A) It stores 24.9 into ptr. B) It stores 24.9 into the variable pointed to C) It stores 24.9 into x. D) B and C above E) A, B, and C above by ptr. 31. Given the declarations float+ ptrl; float ptr2; which of the following is a valid assignment? A) ptri ptr2; B) *ptr1=ptr2 ; D) A and C above E) A, B, and c above 32, I f a c+t class declaration begins with the line class A : public B ( then which of the following is true? A) Public members of B become public members of A B) Public members of B become private members of A. c) Public members of A become public members of B. D) B and C above. 33. For a C+ class named Myclass, the member function whose prototype is MyClass( const Myclass & other ); which of the following is: A) a conversion constructor 3) C) a copy-constructor D) an overloaded assignment operator B) none of the above. 34. If a c++ class instance points to dynamic data and a class destructor has not been provided, what happens when the class instance is destroyed: A) The result is a dangling pointer B) The result is memory leak ) The dynamic data is automatically deallocated. Program execution is aborted None of the above.

Given the declarations double x: double* ptr = &x: What does the following statement do? *ptr = 24.9: A) It stores 24.9 into ptr. B) It stores 24.9 into the variable pointed to by ptr. C) It stores 24.9 into x. D) B and C above E) A, B, and C above Given the declarations float * ptr1: float * ptr2: which of the following is a valid assignment? A) ptr1 = ptr2: B) *ptr1= ptr2: C) *ptr1 = *ptr2: D) A and C above E) A, B, and C above If a C++ class declaration begins with the line class A: public B { then which of the following is true? A) Public members of B become public members of A. B) Public members of B become private members of A. C) Public members of A become public members of B. D) B and C above. For a C++ class named MyClass, the member function whose prototype is MyClass(const Myclass & other): which of the following is: A) a conversion constructor B) a destructor C) a copy-constructor D) an overloaded assignment operator E) none of the above. If a C++ class instance points to dynamic data and a class destructor has not been provided, what happens when the class instance is destroyed: A) The result is a dangling pointer. B) The result is memory leak. C) The dynamic data is automatically deallocated. D) Program execution is aborted. E) None of the above.

Expert Answer

 

30)

Ans: b) it stores 24.9 into the variable pointed to by ptr

31)

Ans: d) A and C above

32)
Ans: D) Bothe B and C

33)MyClass(const MyClass & other)

Ans: c) a copy constructor.

34)

Ans: c)The dynamic data is automatically deallocated.

Still stressed from student homework?
Get quality assistance from academic writers!