c – C中的\u0026\u0026\u0026\u0026操作是什么

int main()
{
        int i,c;
i:
        for (i = 0; i < 3; i++) {
                c = i &&&& i;
                printf("%d\n",c);
        }
        return 0;
}

使用gcc编译的上述程序的输出

0
1
1

如何在上述计划中评估?

最佳答案
使用标签作为值是gcc扩展(见here).你的表达段:

c = i &&&& i;

相当于:
    c = i&& (安培;&安培;ⅰ);
其中&& i是标签i的地址.

请记住,你在这里结合了两个完全不同的“对象”.第一个是循环通过0,1,2的i变量,而第二个是标签i,其地址总是一些非零值.

这意味着只有当变量i为0时,放在C中的结果才为0(假).这就是你得到0,1序列的原因.

As an aside,I give serIoUs thoughts to “employee management practices” if one of my minions bought me code like this for production use. Anything that removes the possibility of monstrosities like this would be a good thing in my opinion

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...