test
来源:互联网 发布:nginx alias 编辑:程序博客网 时间:2024/05/22 14:01
#include<iostream>
using namespace std;
int main()
{
int *p=new int;
cout<<"未初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
*p=20;
cout<<"初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
delete p;
cout<<"删除后的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
long *j=new long;
cout<<"未初始化的*j和j(long):"<<*j<<" "<<j<<" "<<j-1<<" "<<j+1<<" "<<endl;
*j=55;
cout<<"初始化的*j和j(long):"<<*j<<" "<<j<<" "<<j-1<<" "<<j+1<<" "<<endl;
cout<<"初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
p=NULL;
cout<<"NULL后的*p和p(int):"<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
j=NULL;
cout<<j<<endl;
return 0;
}
using namespace std;
int main()
{
int *p=new int;
cout<<"未初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
*p=20;
cout<<"初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
delete p;
cout<<"删除后的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
long *j=new long;
cout<<"未初始化的*j和j(long):"<<*j<<" "<<j<<" "<<j-1<<" "<<j+1<<" "<<endl;
*j=55;
cout<<"初始化的*j和j(long):"<<*j<<" "<<j<<" "<<j-1<<" "<<j+1<<" "<<endl;
cout<<"初始化的*p和p(int):"<<*p<<" "<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
p=NULL;
cout<<"NULL后的*p和p(int):"<<p<<" "<<p-1<<" "<<p+1<<" "<<endl;
j=NULL;
cout<<j<<endl;
return 0;
}
- test
- test
- test
- test
- test
- test
- test
- Test
- test
- Test
- test
- test
- test
- test
- test
- test
- test
- Test
- 学习心得
- 全排列
- 面试题及其答案
- 初出茅庐那些年
- MM委外业务
- test
- 开始管理代码
- Codeforces Beta Round #97 (Div. 2)
- Codeforces Beta Round #97 (Div. 2) (三进制)
- CArray::operator [ ] 的两个版本
- Codeforces Beta Round #97 (Div. 2)
- 学习笔记
- Codeforces Beta Round #97 (Div. 2) (判断正方形和矩形)
- 基于Android的浮动组件,可以用于应用中的新功能展示等等