Multiple choice

Which of the following statements is false regarding inline function in C++?

  1. All functions declared inside a class are inline functions by default.

  2. Inline functions can be declared outside a class by using inline keyword.

  3. Any modifications in an inline function needs recompilation of the program to use modified functionality.

  4. Declarartion of a function which is inside a class with inline keyword leads to compile time error.

  5. By declaring small functions (with less computation time) as inline function, performance of the program is increased.

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

This statement is false. We know if we declare a function inside a class, it is implicitly inline function. Eventhough we explicitly write inline keyword for a function inside a class, compiler does the same. It doesnt raise compile time error. Hence, this is a false statement & correct option to choose according to the question.