#include <stdio.h>
volatile int i;
int main()
{
int c;
for (i = 0; i < 3; i++)
{
c = i &&& i;
printf("%d\n", c);
}
return 0;
}
ผลลัพธ์ของโปรแกรมข้างต้นที่คอมไพล์ใช้gccคือ
0
1
1
ด้วย-Wallหรือ-Waddressตัวเลือกgccออกคำเตือน:
warning: the address of ‘i’ will always evaluate as ‘true’ [-Waddress]
การcประเมินในโปรแกรมข้างต้นเป็นอย่างไร
while (i &&& i <-- j) {}.
i && (&i)? น่าสนใจที่ฉันไม่พบโพสต์ซ้ำใน SO