但是在优先级表中清楚地写着后缀运算符的优先级高于前缀。但我仍然有一个疑问。
我从以下示例开始:
*ptr++; // evaluate as *(ptr++);
++*ptr; // evaluate as ++(*ptr);
这证明后缀运算符比前置运算符具有更高的优先级。
现在在下面的例子中它似乎不正确:
int a=0,b,c;
b=a++; //b=0 ,here it seems ++ has lower priority that is after assignment increment is performed.
c=++a; //b=2 ,here it seems ++ has higher priority.
在上面的示例中,后缀运算符的优先级似乎不是低于前缀吗?