#include <stdio.h> //逗号表达式先计算p=p+2,指向3 //*p++:*与++优先级相同,右结合性,(*)p++, //输出时先用后加,所以表达式值为3 (*p=4) // p=p+2=6 //*++p:优先级相同,右结合,*(++p),先加后用,逗号表达式值为7 main() { int a[]={1,2,3,4,5,6,7,8,9,10}; int *p=a; printf("%d\n",(p+=2,*p++)); printf("%d\n",(p+=2,*++p)); getchar(); }
标签:自增,优先级,相同,++,值为,C语言,自减,printf,表达式 From: https://www.cnblogs.com/xkdn/p/16708763.html