fork download
  1. #include <map>
  2. #include <iostream>
  3.  
  4. static std::map<int, const char*> staticMap;
  5.  
  6. const char *dummy = (
  7. staticMap[0]="a",
  8. staticMap[1]="b",
  9. staticMap[2]="c",
  10. staticMap[3]="d",
  11. staticMap[4]="e");
  12.  
  13. int main() {
  14. std::cout << "# Items: " << staticMap.size() << '\n' << std::endl;
  15. std::cout << "Map Contents:" << std::endl;;
  16. for (unsigned i = 0; i < 5; ++i) {
  17. std::cout << "\t" << staticMap[i] << std::endl;
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
# Items: 5

Map Contents:
	a
	b
	c
	d
	e