源程序:
#include <iostream>
using namespace std;
int main()
{
int a1 = 3;
const int a2 = a1; //数据a2是常量
int *a3 = &a1; //普通指针指向普通变量
const int *a4 = &a1; //指向常量的指针
int *const a5 = &a1; //常量指针
int const * const a6 = &a1; //指向常量的常量指针
const int * const a7 = &a1; //指向常量的常量指针
cout << a1 <<" "<< a2 << " "<<a3<<" "<<a4<<" "<<a5<<" "<<a6<<" "<<a7<<endl;
system("pause");
return 0;
}