Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ googletest文档C字符串和字符串_C++_C_String_Googletest - Fatal编程技术网

C++ googletest文档C字符串和字符串

C++ googletest文档C字符串和字符串,c++,c,string,googletest,C++,C,String,Googletest,我正在阅读,我正在学习一种用于比较字符串的语法,另一种用于比较C字符串。我看不出什么被称为C字符串和字符串。这些不同是什么?STD::String通常被称为C++字符串。使用字符串,例如 const char *text = "text"; 被称为CStrings 更多信息可在此处找到: STD::String通常被称为C++字符串。使用字符串,例如 const char *text = "text"; 被称为CStrings 更多信息可在此处找到: 如果尝试对C字符串使用ASSERT

我正在阅读,我正在学习一种用于比较字符串的语法,另一种用于比较C字符串。我看不出什么被称为C字符串和字符串。这些不同是什么?

STD::String通常被称为C++字符串。使用字符串,例如

 const char *text = "text";
被称为CStrings

更多信息可在此处找到:

STD::String通常被称为C++字符串。使用字符串,例如

 const char *text = "text";
被称为CStrings

更多信息可在此处找到:

如果尝试对C字符串使用ASSERT_EQ,则只比较两个指针,而不是真正以null结尾的C字符串。因为存在ASSERT_STREQ语法。

如果尝试对C字符串使用ASSERT_EQ,则只比较两个指针,而不是真正以null结尾的C字符串。因此,存在ASSERT_STREQ语法