Question 104Asked in BPSC TRE 2.0 (2023) Computer Science Class 11-12

Choose the correct statement about inline function in C++.

  1. AIt speeds up the execution.
  2. BIt slows down the execution.
  3. CIt decreases the code size.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) It speeds up the execution.

Explanation

An inline function's body is substituted at the call site, so there is no function-call overhead and execution is faster. It usually makes the code bigger, not smaller.

From BPSC TRE 2.0 (2023) Computer Science Class 11-12 — Previous Year Paper

This is question 104 of BPSC TRE 2.0 (2023) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.