Multiple choice

In which of the following situations may an inline function work in C++?

  1. When the inline function definition is too long or too complicated

  2. When the inline function is recursive

  3. When the inline function has looping constructs

  4. When the inline function has a switch or a goto statement

  5. When the inline function starts with the keyword 'inline'

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

This is a situation where an inline function may work in C++ as an inline function must start with the keyword 'inline'.