Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Special Characters to Avoid in Strings

This articles talks about special characters to avoid in various places. You might not encounter issues most of the time when violating rules stated below, however, you never know when things will break. It is more for a good-practice suggestion.

String for Shell

  1. When you pass parameters from one program …

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 …