Skip to main content
C++ Code Completion Easy +10 XP

Auto Keyword

Complete using the auto keyword.

C++Fill in the blank
___ result = 3.14 * 2;

Type the missing code

Show answer and explanation

Answer: auto

The auto keyword lets the compiler deduce the type automatically from the initializer.

Hint: C++11 added automatic type deduction.

What this challenge tests

Code Completion in C++: auto, type-deduction.

Related challenges