如题所述
char *a = "123";
char *b = "1234";
int c = strcmp(a, b);
if (0 == c)
{
printf("相等\n");
}
else
{
printf("不相等"\n);
}
char *b = "1234";
int c = strcmp(a, b);
if (0 == c)
{
printf("相等\n");
}
else
{
printf("不相等"\n);
}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2018-05-18
strcmp,如果不是0就不相等