I just started to learn C ++. Since I have experience with Python and I am looking for a similar data structure like dictionary in Python. Here is what I found:
#include <stream> #include <map> using namespace std; int main() { map<string,string> dict; dict["foo"] = "bar"; cout<<dict["foo"]<<"\n"; return 0; }
Compile and run, you will get:
bar
source share