prev up next   top/contents search

comp.lang.c FAQ 列表· 问题 4.3

QDoes*p++incrementp, or what it points to?


AThe postfix++--operators essentially have higher precedence than the prefix unary operators. Therefore,*p++is equivalent to*(p++); it incrementsp, and returns the value whichppointed to beforepwas incremented. To increment the value pointed to byp, use(*p)++(or perhaps++*p, if the evaluation order of the side effect doesn't matter).

References: K&R1 Sec. 5.1 p. 91
K&R2 Sec. 5.1 p. 95
ISO Sec. 6.3.2, Sec. 6.3.3
H&S Sec. 7.4.4 pp. 192-3, Sec. 7.5 p. 193, Secs. 7.5.7,7.5.8 pp. 199-200


prev up next   contents search
关于此 FAQ 列表   关于 Eskimo   搜索   反馈   版权

Eskimo North 托管