【发布时间】:2013-09-06 13:32:41
【问题描述】:
好吧,我实际上是在看 strcmp() ,对它的工作感到困惑。不管怎样,我写了这段代码
#include <stdio.h>
main()
{
char a[5] = "ggod";
char b[5] = "ggod";
int c = 0;
c = b - a;
printf("%d value", c);
}
我得到的输出为
16
谁能解释为什么是16?
【问题讨论】:
-
这有什么意义?因为 C 被声明为 int
-
就 strcmp 的工作方式而言,这可能会有所帮助:stackoverflow.com/questions/12136329/how-does-strcmp-work
标签: c arrays string character-arrays