有点不明白
32. What will be the result of the following program?main()
{char p[]="String";
int x=0;
if(p=="String")
{printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
最终的结果 Fail 1, Pass 2,而printf("%s",p);出来的结果就是string 为什么会出faile1 if(p=="String")