Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Give reasonably brief, but complete answers to the following. 7. When a function has an object parameter that it doesn't modify, what is the best

Give reasonably brief, but complete answers to the following.
7. When a function has an object parameter that it doesn't modify, what is the best way to declare the parameter (in the function signature), and why? Show an example using a function with a string object parameter. -------------------------------------------------------------------- 8. (a) When should a member function be declared as a 'const' member function? (b) What are the advantages of defining a member function as 'const'? -------------------------------------------------------------------- 9. a) When a class has objects as data members, why should its constructors use initialization lists (member and initializer syntax) vs. assignment to the members in the body of the ctor? b) Name two cases where you *must* use initialization lists in constructors (as opposed to assignment in the ctor body). 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

Students also viewed these Databases questions