What is an inline function in C++?
20 views
- A function that is declared inside a class.
- A function that is executed in-line with the calling code. (Correct Answer)
- A function that is used to overload the << operator.
- A function that returns a reference to an object.
Explanation
Correct answer: b) A function that is executed in-line with the calling code.
Explanation: An inline function in C++ is a function that is expanded in-line at the point of call, rather than being executed as a separate function call. This can lead to faster code execution, but also increases code size.