Answer these questions about destructors

a. What is a destructor and what must the name of a destructor be?
b. When is a destructor called?
c. What does a destructor actually do?
d. What should a destructor do?


a) A destructor is a member function of a class named ~NameOfClass. b) A destructor is called automatically at the end of the block when a class object goes out of scope. c) A destructor actually does whatever the class author has written into the destructor d) A destructor should release any resources that the constructor has allocated, including releasing dynamically allocated memory.

Computer Science & Information Technology

You might also like to view...

In the accompanying figure, the area towards the bottom of the screen that says "The city of Savannah was founded ..." is set aside for _____.

A. speaker notes B. author notes C. audience notes D. Web authoring notes

Computer Science & Information Technology

The _______ pseudo-class configures the styles that will apply when the mouse is placed over a hyperlink.

a. :hover b. :click c. :active d. :over

Computer Science & Information Technology

Software that is available for use with the user paying a voluntary fee is known as ________

A) driver software B) freeware C) shareware D) retail software

Computer Science & Information Technology

Holly is trying to use Windows Defender to run an antivirus scan. Windows Defender refuses to run. She notices a problem when she tries to update Windows Defender and it fails. When Holly opens the Action Center she sees this screen. What has happened to Holly’s computer?

A. She has received a spam message. B. She has received a security alert message. C. Someone has hijacked her email. D. She has downloaded a rogue antivirus.

Computer Science & Information Technology