自考新教材-p58_3(2)

源程序:

#include <iostream>
using namespace std;
int main()
{
const int x = 5, y = 6;
const int *p = &x;
p = const_cast<int *>(&y);
cout << *p << endl;
system("pause");
return 1;
}

运行结果:

 

posted @ 2020-02-06 14:00  bobo哥  阅读(113)  评论(0编辑  收藏  举报