您的位置:首页 > 编程语言 > C语言/C++

Sample 4.17:use_new.cpp

2013-12-02 22:07 405 查看
#include<iostream>
int main()
{
using namespace std;
int * pt = new int ;
*pt = 1001;
cout << "int ";
cout << "value = " << *pt << ": location = " << pt << endl;

double * pd = new double;
*pd = 10000001.0;

cout << "double ";
cout << "value = " << *pd << ": location = " << pd << endl;
cout << "size of pt = " << sizeof(pt);
cout << ": size of *pt = " << sizeof(*pt) << endl;
cout << "size of pd = " << sizeof pd;
cout << ": size of *pd " << sizeof ( *pd) << endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: