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; }
相关文章推荐
- Sample 4.16:init_ptr.cpp
- Sample 4.15:pointer.cpp
- Sample 4.14:address.cpp
- Sample 4.13:arrstruct.cpp
- C语言动态存储分配
- Sample 4.12:assgn_st.cpp
- Sample 4.11:structur.cpp
- Sample 4.9:strtype3.cpp
- Sample 4.8:strtype2.cpp
- Sample 4.7:strtype1.cpp
- Sample 4.6:numstr.cpp
- Sample 4.5:instr3.cpp
- Sample 4.4:instr2.cpp
- Sample 4.3:instr1.cpp
- Sample 4.2:string.cpp
- Keil C51对C语言的关键词扩展之十七: sbit
- c++写的一个简单的管理系统
- memcpy和memmove的区别
- C++基础学习笔记----第四课(函数的重载、C和C++的相互调用)
- VC++中字符串编码的转换