解析
第三题:
//What is the output of this C code?
#include <stdio.h>
int main()
{
int x = 1, y = 0, z = 3;
x > y ? printf("%d", z) : return z;
}
在:前后都要有表达式,不然会出现compile time error。可以改成下面这样:
//What is the output of this C code?
#include <stdio.h>
int main()
{
int x = 1, y = 0, z = 3;
x > y ? printf("%d", z) : printf(" ");
return z;
}