1 Star 0 Fork 0

学习代码/c++study

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
memory.cpp 481 Bytes
一键复制 编辑 原始数据 按行查看 历史
王乾坤 提交于 2024-01-26 00:13 +08:00 . 添加day02
#include <iostream>
#include <cstring>
#include <new>
using namespace std;
int main()
{
int* pi = new int;
int n = 200;
*pi = 2*100;
char* pc = new char[n];
double* pd = new(nothrow) double[0xf0000000];
long *pl = new long(123);//123
short *ps = new short();// ?
strcpy(pc ,"欢迎你");
pd[10] = 123.45;
cout << *pi << ","<< pc << "," << pd[10] << ","<< *pl << ","<< *ps << endl;
delete pi;
delete[] pc;
delete[] pd;
delete[] pl;
delete ps;
//return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/qk_study/c-study.git
git@gitee.com:qk_study/c-study.git
qk_study
c-study
c++study
master

搜索帮助