#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) {}。
重複ではありませんが、同様の質問であり、それは良いリンクです
—
Nathan Cooper
i && (&i)か?興味深いことに、SOで重複する投稿を見つけることができません。