Ace Your C++ Skills 2026 – Rock the ‘Thinking in C++’ Challenge!

1 / 565

How does the compiler treat a function defined inside a class body?

As a virtual function.

As an inline function.

A function defined inside a class body is automatically considered inline unless explicitly declared as virtual, private, or static. Therefore, options A, C, and D are incorrect. Option A is incorrect because a function inside a class body is not automatically considered virtual. Option C is incorrect because there is no explicit access modifier mentioned. Option D is incorrect because a static function is not automatically defined inside a class body.

Get further explanation with Examzify DeepDiveBeta

As a private function.

As a static function.

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy