主页
C 语言
C 字符串函数
demo_strings_strcmp
运行 ❯
×
更改方向
保存代码
更改主题
#include
#include
int main() { char str1[] = "Hello"; char str2[] = "Hello"; char str3[] = "Hi"; // Compare str1 and str2, and print the result printf("%d\n", strcmp(str1, str2)); // Compare str1 and str3, and print the result printf("%d\n", strcmp(str1, str3)); return 0; }
0
-4