1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #include <cstdio> 10 #include <iostream> 11 #include <string> 12 #include <map> main(int argc,char const * argv[])13int main (int argc, char const *argv[]) 14 { 15 std::string hello_world ("Hello World!"); 16 std::cout << hello_world << std::endl; 17 std::cout << hello_world.length() << std::endl; 18 std::cout << hello_world[11] << std::endl; 19 20 std::map<std::string, int> associative_array; 21 std::cout << "size of upon construction associative_array: " << associative_array.size() << std::endl; 22 associative_array[hello_world] = 1; 23 associative_array["hello"] = 2; 24 associative_array["world"] = 3; 25 26 std::cout << "size of associative_array: " << associative_array.size() << std::endl; 27 printf("associative_array[\"hello\"]=%d\n", associative_array["hello"]); 28 29 printf("before returning....\n"); // Set break point at this line. 30 } 31