C++ Programming/Programming Languages/C++/Code/Keywords/auto
The auto
keyword is used to have the compiler infer the type of the variable which follows it from the RHS or from its declaration.
Example[edit | edit source]
auto a = 3; // int
auto b = 4.5; // double
auto p = &a; // pointer