MT1 PracticeProblems - = = The destructor of a class a Must...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
========================================== ===================== The destructor of a class a.) Must not have a return type b.) Must have the return type void or int c.) Must have the return type int, but if a return statement is not found in the body, the function will return 0 by default d.) Must return an object of type ~ ========================================== ===================== A doubly-linked list is: a.) A linked list where the tail pointer points to the head pointer b.) A linked list where each node has references to both the previous and next node in the list c.) A linked list where each node also has a reference to the head pointer d.) A pair of linked lists of the same length where each node of each linked list also points to its corresponding node in the other list. ========================================== ===================== What would the following code do? #include <string> class Person { public : Person (string name): m_name(name) {} private : std::string m_name; }; int main() { Person p; return 0; } a.) Call the automatically generated parameter-less default constructor b.) Call the user-defined constructor with the parameter's default values (here name would be set to "")
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
c.) Fail to compile d.) Do nothing 1. What does the following code print out?
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern