Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the declarations double x: double* ptr = &x;: What does the following stat

ID: 3867444 • Letter: G

Question

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.

Explanation / 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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote