LearnFrenzy
Sign in Take a free test

Functions and Default Arguments · Functions MCQ · Question 12

What does inline mean in modern C++? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 12 Back to Exercise

What is the main effect of declaring a function inline in modern C++?

  • A The call is always replaced by the body
  • B The function may be defined in several translation units (e.g. in a header) without violating the one-definition rule Correct
  • C The function cannot be recursive
  • D The function runs at compile time
Correct Answer: Option B

Compilers decide on their own which calls to expand; the keyword's guaranteed meaning is about linkage and multiple definitions.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links