googletest doc C字符串和字符串
答
std::string
通常被称为C++ string
。使用字符串如
const char *text = "text";
称为CStrings。
更多的信息可以在这里找到:
What is the difference between char * const and const char *?
答
如果您尝试使用ASSERT_EQ
到C字符串,你想比较两个三分球,但没有真正空终止的C -Strings。为此,存在ASSERT_STREQ
语法。