1int foo = 0;
2auto bar = foo; // the same as: int bar = foo;
3// type of bar is the type of the value used to initialize it
1#include<iostream>
2#incllude<vector>
3using namespace std;
4
5int main() {
6 vector<int> vec(10); // Auto deduce type to be iterator of a vector of ints.
7 for(auto it = vec.begin(); it != vec.end(); vec ++)
8 {
9 cin >> *it;
10 }
11 return 0;
12}