下列代码给出输出结果:
#include"stdafx.h"
#include <iostream>
#include "stdlib.h"
using namespace std;
int main(void)
{
const int a = 10;
int * p = (int *)(&a);
*p = 20;
cout << "a = " << a << ", *p = " << *p << endl;
cout << &a << endl << p << endl; //本人测试时添加的
system("pause");
return 0;
}
运行结果如下: