自减运算符 vs 减法运算符

decrement operator vs subtraction operator

如果我写这样的代码(在 c 中)

    x=1;
    z=2;
    y=x---z;

将前两个 - 视为 post-减量,后一个视为减法

或第一个-将被视为减法,其他两个被视为预减

如果我把一个 space 变成另一个呢(因为在 c 程序中不会被白色 space 改变)

根据 C11 标准,第 §6.4 章,词汇元素(强调我的)

If the input stream has been parsed into preprocessing tokens up to a given character, the next preprocessing token is the longest sequence of characters that could constitute a preprocessing token. [..]

所以,

y=x---z;

y= (x--) - z;

这也称为 Maximal munch 规则。