I have discovered a disturbing inconsistency between std::string and string literals in C++0x:
std::string
#include #include
If you wanted the length, you should use strlen() for the C string and .length() for the C++ string. You can't treat C strings and C++ strings identically--they have different behavior.
strlen()
.length()