gpt4 book ai didi

c - =+(等于加号)在 C 语言中是什么意思?

转载 作者:太空狗 更新时间:2023-10-29 16:19:10 25 4
gpt4 key购买 nike

我今天在一些 C 代码中遇到了 =+ 而不是标准的 +=;我不太确定这里发生了什么。我在文档中也找不到它。

最佳答案

古代 版本的 C 中,=+ 等同于 +=。在最早的恐龙骨骼旁边发现了它的遗迹。

For example, B introduced generalized assignment operators, using x+=y to add y to x. The notation came from Algol 68 via McIlroy, who incorporated it in his version of TMG. (In B and early C, the operator was spelled =+ instead of +=; this mistake, repaired in 1976, was induced by a seductively easy way of handling the first form in B's lexical analyzer.)

[C 语言的发展,丹尼斯里奇。版权所有 ACM,1993。省略内部引用。]

自 20 世纪 70 年代中期以来,它没有特殊含义 -- 它只是一个 = 后跟一个 +

关于c - =+(等于加号)在 C 语言中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7573978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com