| 1 | #include <cstdio> |
|---|---|
| 2 | #include <iostream> |
| 3 | #include <string> |
| 4 | #include <map> |
| 5 | int main (int argc, char const *argv[]) |
| 6 | { |
| 7 | std::string hello_world ("Hello World!"); |
| 8 | std::cout << hello_world << std::endl; |
| 9 | std::cout << hello_world.length() << std::endl; |
| 10 | std::cout << hello_world[11] << std::endl; |
| 11 | |
| 12 | std::map<std::string, int> associative_array; |
| 13 | std::cout << "size of upon construction associative_array: "<< associative_array.size() << std::endl; |
| 14 | associative_array[hello_world] = 1; |
| 15 | associative_array["hello"] = 2; |
| 16 | associative_array["world"] = 3; |
| 17 | |
| 18 | std::cout << "size of associative_array: "<< associative_array.size() << std::endl; |
| 19 | printf(format: "associative_array[\"hello\"]=%d\n", associative_array[ "hello"]); |
| 20 | |
| 21 | printf(format: "before returning....\n"); // Set break point at this line. |
| 22 | } |
| 23 |
