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 …