Skip to content

Instantly share code, notes, and snippets.

@Alligator
Created February 19, 2015 21:04
Show Gist options
  • Save Alligator/dd94d297abd515c8e790 to your computer and use it in GitHub Desktop.
Save Alligator/dd94d297abd515c8e790 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <map>
using namespace std;
int main() {
map<char, int> stuff;
stuff['a'] = 1;
stuff['b'] = 2;
stuff['c'] = 3;
map<char, int> &ref = stuff;
ref['d'] = 4;
cout << stuff['d'] << endl;
// prints 4
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment