C++ Primer 4/e 在string这里有一个警告:‘For historical reasons, and for compatibility with C, character string literals are not the same type as the standard library string type. This fact can cause confusion and is important to keep in mind when using a string literal or the string data type.’
中文版的是这样说:‘由于历史因素和C相容性,字元字串字面常数(character string literals)的型别和C++标准库的string型别并不相同。这可能会造成困惑。在使用字串字面常数或string型别时,这是一件必须放在心上的重要事情。’
嗯,我很习惯C的用法,改到C++时确实不太了解这之间的差别。