auto (type deduction)
Deduces the type automatically.
Syntax
auto name = value;
Description
The type is inferred from the value; saves you from typing long type names.
Example
Loading editor…
Expected output
42 3.14
When to use?
Short definition, complex types.