Skip to content

Instantly share code, notes, and snippets.

@akorobov
Created March 28, 2013 00:42
Show Gist options
  • Save akorobov/5259538 to your computer and use it in GitHub Desktop.
Save akorobov/5259538 to your computer and use it in GitHub Desktop.
c++ - statically typed language
#include <map>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
// map of int -> string
// note that string is not included
map<int, std::string> m;
// assigning integer instead of string
// compiles just fine, sigh...
m[1] = 42;
cout << "m[1]=" << m[1] << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment