Which statement about class unique_ptr (of the new C++ standard) and dynamic memory allocation is false?
a. An object of class unique_ptr maintains a pointer to dynamically allocated memory.
b. When a unique_ptr object destructor is called (for example, when a unique_ptr object goes out of scope), it
performs a destroy operation on its pointer data member.
c. Class template unique_ptr provides overloaded operators * and -> so that a unique_ptr object can be used just as a
regular pointer variable is.
d. Class unique_ptr is part of the new C++ standard and it replaces the deprecated auto_ptr class.
b. When a unique_ptr object destructor is called (for example, when a unique_ptr object goes out of scope), it
performs a destroy operation on its pointer data member.
You might also like to view...
A vector called aList has size 6. After the following function calls, what will its size be?
aList.push_back (someThing); aList.push_back(anyThing); aList.pop_back (); a) 5 b) 6 c) 7 d) 8
Dynamic memory allocation occurs
a. when a new variable is created by the com-piler b. when a new variable is created at runtime c. when a pointer fails to dereference the right variable d. when a pointer is assigned an incorrect ad-dress e. None of these
Write static methods that implement these recursive formulas to compute geometric( n) and harmonic(n). Do not forget to include a base case, which is not given in these formulas, but which you must determine. Place the methods in a test program that allows the user to compute both geometric(n) and harmonic(n) for an input integer n. Your program should allow the user to enter another value for n and repeat the calculation until signaling an end to the program. Neither of your methods should use a loop to multiply n numbers.
A geometric progression is defined as the product of the first n integers, and is denoted as
geometric(n) =
Can you discover a rule for multiplying common base numbers that have exponents?
What will be an ideal response?