Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Question: 1 / 50

For what reason might a reader prefer placing the opening brace on its own line, according to a advice mentioned in the text?

It aids in scannability for complex conditionals

Placing the opening brace on its own line is recommended because it aids in scannability for complex conditionals, as mentioned in the text. This is because it clearly separates the beginning of the code block, making it easier for readers to identify the start and end of the conditional statement. Option B is incorrect because the C++ standard does not specifically mention this recommendation. Option C is incorrect because elegance is subjective and may differ among readers. Option D is incorrect because while Bjarne Stroustrup is a major contributor to the development of C++, this specific recommendation may not have been explicitly made by him.

It is recommended by the C++ standard

It makes the code more elegant

Bjarne Stroustrup advocated for it

Next

Report this question