运算符#
介绍#
Operators in C++ are symbols that let you perform operations on variables and values. They include arithmetic, logical, comparison, assignment, and bitwise operators. C++ also supports increment/decrement, conditional expressions, and compound assignment. These form the core of most logic and math in any C++ program, including robotics control with VEXcode IQ.
Arithmetic#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
添加 |
|
|
|
减法 |
|
|
|
乘法 |
|
|
|
分配 |
|
|
|
模数 |
|
|
|
否定 |
|
|
|
Augmented Arithmetic#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
添加 |
|
|
|
减法 |
|
|
|
乘法 |
|
|
|
分配 |
|
|
|
模数 |
|
|
|
Comparison#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
平等 |
|
|
|
不等式 |
|
|
|
大于 |
|
|
|
少于 |
|
|
|
大于或等于 |
|
|
|
小于或等于 |
|
|
|
Logical#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
逻辑与 |
|
|
|
逻辑或 |
|
|
|
逻辑非 |
|
|
|
Assignment#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
任务 |
|
|
|
Bitwise#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
按位与 |
|
|
|
按位或 |
|
|
|
按位异或 |
|
|
|
按位非 |
|
|
|
左移 |
|
|
|
右移 |
|
|
|
Augmented Bitwise#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
按位与 |
|
|
|
按位或 |
|
|
|
按位异或 |
|
|
|
左移 |
|
|
|
右移 |
|
|
|
Ternary (Conditional)#
姓名 |
句法 |
例子 |
|---|---|---|
条件运算符 |
|
|
Increment / Decrement#
姓名 |
象征 |
操作员 |
例子 |
|---|---|---|---|
预增量 |
|
|
|
后增量 |
|
|
|
预减 |
|
|
|
后减量 |
|
|
|