Question: 9. What is an inline function? When are inline functions used? Give a short example. 10. What is a default argument? Write the prototype

9. What is an inline function? When are inline functions used? Give a short example. 10. What is a default argument? Write the prototype for a function that calculates the area of a triangle with default arguments base 1. Exemplify the use of default arguments 1 and height with three function calls: one with defaut arguments, another with both values equal to 2 and the last having one value given to be equal to 3. 11. Explain the mechanism of function overloading in C++. Give a short example. What is name decoration/mangling? 12. Explain what is a function template. Write then a function template to find the min of two values, and a driver program to determine the minimum for the values 2, 5 then for 1.5, 2.6. 13. Consider the class Monkey declared bellow. Write the member functions declared below and the definition of the overloaded +. Modify the class declaration and write the definitions that over- load the stream extraction and stream insertion operators >> and < < to handle Monkey objects like...
Step by Step Solution
3.52 Rating (166 Votes )
There are 3 Steps involved in it
9 An inline function is a function that is expanded in line when it is called instead of being called from a separate piece of code Inline functions a... View full answer
Get step-by-step solutions from verified subject matter experts
