Advertisement
obernardovieira

Struct array (name not id) using map

Apr 9th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. struct admin {
  6.     int level;
  7. };
  8.  
  9. std::map<std::string,struct admin> adminmap;
  10.  
  11. int main() {
  12.     adminmap["dartakous"].level = 20;
  13.     std::cout << "hi!" << std::endl;
  14.     std::cout << adminmap["dartakous"].level << std::endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement