c# -++后缀和前缀的由来

标签 c# c++ c

<分区>

谁知道++ 后缀和后缀形式的起源和原因。我知道它们甚至在 C 中也可用。但是谁发明了它们;甚至用其他语言?

最佳答案

来自 Dennis M. Ritchie,The Development of the C Language , HOPL II, 1993:

For example, B introduced generalized assignment operators, using x=+y to add y to x. The notation came from Algol 68 [Wijngaarden 75] via McIlroy, who had incorporated it into 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.)

Thompson went a step further by inventing the ++ and -- operators, which increment or decrement; their prefix or postfix position determines whether the alteration occurs before or after noting the value of the operand.

关于c# -++后缀和前缀的由来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28326342/

相关文章:

c++ - 从主循环调用守护进程函数?

c - 指向 C 中函数的指针

c - size_t 的长度不正确?

c# - 基本 C# 语法问题

c# - 在 CSharpScript 的脚本类中访问全局变量

c++ - sizeof(int) 是否总是等于 sizeof(void*)

c - 仅针对特定类型的#pragma 声明 Clang 的 -fno-caret-diagnostics

c# - WebAPI + OWIN + SignalR + Autofac

c# - "Entry point was not found"与 MVC 5 和 StructureMap

c++ - 如果我在 C++ 中使用内联函数,为什么会重新定义“template<class T>”?