其他运算符(Other operator)
操作符 | 含义 | 示例 |
---|---|---|
sizeof() |
返回变量的字节大小 | sizeof() |
& |
返回变量的地址 | &a |
* |
指向变量的指针 | *a |
?: |
条件运算符(Ternary Operator) | if_condition_is_true ? then_value_x : otherwise_value_y |
显示类型转换运算符(Explicit type casting operator)
int i;
float f = 3.14;
i = (int) f;
成员和指针运算符(Member and pointer operators)
Operator | Syntax | Meaning |
---|---|---|
下标(Subscript) | a[b] |
|
Indirection | *a |
a 指向的对象 |
Indirection | &a |
a 的地址 |
三元运算符
conda