/*
(*p1)++ 是先取了变量,然后对变量值(强调是值)进行了++运算。
结果是指针变量的值未发生变化。
*p2++ 是先取指针指向的变量值,然后对指针(强调是指针)进行++运算。
结果是指针变量的值更新为新变量的地址。在下一次运算时生效
*(p3++) 是和 *p3++没有区别
*/
#include <iostream>
using namespace std;
int main()
{
int *p1 = NULL, *p2 = NULL,*p3=NULL;
int buf1[3] = { 10, 5, 8};
int buf2[3] = { 10, 5, 8};
int buf3[3] = { 10, 5, 8};
p1 = &buf1[0];
p2 = &buf2[0];
p3 = &buf3[0];
cout << (*p1)++ << endl;
cout << *p1 << endl;
cout << *p2++ << endl;
cout << *p2 << endl;
cout << *(p3++) << endl;
cout << *p3 << endl;
system("pause");
return 0;
}