#include <iostream>
#include <map>
using namespace std;
int main()
{
map<int, int> m;
for (int i = 0; i < 5; i++)
m[i]++;
for (int i = 0; i < 5; i++)
cout<<m[i];
}
Output:
11111
Now, how come value of m[i] is getting initialized? Shouldn't it translate to m[i]'s value incremented by 1?