一、在本例中指针的基本类型是int类型,因此自加1,内存地址增加4个字节
#include <iostream>
using namespace std;
int main()
{
int *p = new int;
cout<<"输出p所指向的内存地址:/t/t"<<p<<endl;
p++;
cout<<"自加后,输出p所指向的内存地址:/t"<<p<<endl;
p--;
cout<<"自减后,输出p所指向的内存地址:/t"<<p<<endl;
p = p-2;
cout<<"自减2后,输出p所指向的内存地址:"<<p<<endl;
return 0;
}