int latitude = 45;
const char *location = "not at the Equator";
//条件必须放在圆括号中:
//if latitude == 0 { //<- Error: expected '(' before 'latitude'
//单个 = 是赋值而不是比较:
//latitude 变成 0,而 0 为 false;
//编译器只给出警告(使用 -Wall 时)
if (latitude = 0) {
location = "Equator";
}
//latitude is 0
//location is "not at the Equator"
printf("latitude is %d\n", latitude);
printf("location is %s\n", location);