Ben Chuanlong Du's Blog

And let it direct your passion with reason.

String in C++11

  1. auto s = "abcd" creats const char * not string, so use auto with caution.

  2. Since a string in C++ is an array of chars, you can operate it like an array. For example, you can use range-based for loop and so on.

  3. It is recommended that you use std::string in …

Make Eclipse Support C++11

  1. Make a new C++ project

  2. Default options for everything

  3. Once created, right-click the project and go to "Properties"

  4. C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put -std=c++0x at the end.

  5. C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste __GXX_EXPERIMENTAL_CXX0X__ …