|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- char str1[10] = "FishC.com";
- char str2[20] = "FIshC.com";
-
- if (strcmp(str1, str2) == 0)
- {
- printf("两个字符串完全一致!\n");
- }
- else
- {
- printf("两个字符串不同!\n");
- }
-
- return 0;
- }
复制代码 无论两字符串是否相同,都显示字符串不同,不知道怎么回事
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- char str1[10] = "FishC.com";
- char str2[20] = "FishC.com";
- //char str2[20] = "FIshC.com"; // 为什么老是犯写错单词的这种低级错误?
- // 你去看一看你之前问的问题,有多少是因为不认真导致的
- // 编程不是谁都可以学的,是有门槛的
- // 不认真的同学不行
- if (strcmp(str1, str2) == 0)
- {
- printf("两个字符串完全一致!\n");
- }
- else
- {
- printf("两个字符串不同!\n");
- }
- return 0;
- }
复制代码
|
|