March 2023
Beginner
441 pages
5h 1m
English
We can automatically deduce the type of an object using the auto specifier. The auto specifier deduces the type of an object based on the object’s initializer type.
This example deduces c to be of type char as the char literal 'a' is of type char.
Here, the compiler deduces the x to be of type int because an integer literal 123 is of type int.