2.17.  Review Questions

[ fromfile: classes-questions.xml id: classes-questions ]

  1. What is the main advantage of using a struct?

  2. Describe at least one difference between a class and a struct.

  3. How does class scope differ from block scope?

  4. Describe two situations where it is OK to use friend functions.

  5. How does a static data member differ from a non-static data member?

  6. What is the difference between a static member function and a non-static member function?

  7. What does it mean to declare a member function to be const?

  8. Explain what would happen (and why) if a class T had a copy constructor with the following prototype?

     T::T(T other);