++ 的优先级高于 *。
*a++ 等价于 *(a++);
*++a 等价于 *(++a);
#include <iostream>
using namespace std;
int main()
{
int test[] = {1, 2, 3, 4, 5};
int *a = test;
cout << *a++ << endl; // 输出1
cout << *a << endl; // 输出2
cout << *++a << endl; // 输出3
cout << *a << endl; // 输出3
}
原文:https://www.cnblogs.com/qinhn3/p/15088744.html