Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started