• auto is used to infer the type of the variable that is being declared and initialized
• In ‘old’ C++:• In C++ 11:
• Anyway,there are restrictions on its usage:
• You cannot use auto as a type of an argument of a function or method.
• Your method return type cannot be auto
• You cannot use auto to declare and initialize variables of several types in the same line, like this:
autox = 2, b = true, c = "hello"; //invalid auto usage