我用C编写了这段代码:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main()
{
char string1[20];
char string2[20];
strcpy(string1, "Heloooo");
strcpy(string2, "Helloo");
printf("%d", strcmp(string1, string2));
return(0);
}
Run Code Online (Sandbox Code Playgroud)
控制台打印值是1还是字符和字符ASCII值之间的差值,即111?在这个网站上写道,这应该给出111,但当我在我的笔记本电脑上运行时,它显示1.为什么?o\0