C++ examples for Data Type:auto
Using Type Deduction with C++ auto keyword, let the compiler deduce the variable type.
#include <iostream> #include <typeinfo> using namespace std; int main()//w ww . jav a 2 s . c om { auto variable = 1; cout << "Type of variable: " << typeid(variable).name() << endl; return 0; }