cielavenir

map::size test

Jan 19th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <map>
  2. #include <iostream>
  3. using namespace std;
  4. main(){
  5.     map<int,int>m;
  6.     cout<<m.size()<<endl; //0
  7.     m[0]=1;
  8.     cout<<m.size()<<endl; //1
  9.     cerr<<m[1]<<endl;     //0
  10.     cout<<m.size()<<endl; //2 ^^;;;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment