Created
March 28, 2013 00:42
-
-
Save akorobov/5259538 to your computer and use it in GitHub Desktop.
c++ - statically typed language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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