当前位置:网站首页>Various ways to use new
Various ways to use new
2022-07-27 13:53:00 【Ape bait】
new:
1:int *p=new int (10);
Open up an integer memory size address and assign it to the pointer p, then 10 Assign to a pointer
2:int *p=new int[10];
open up 10 individual int Type address , And put this 10 individual int The first address of the type size address is assigned to the pointer p
new Release of the pointer coming out :
delate[] array; /delate array[];
3, Assign multiple same values while opening up memory
bool* n;
n = new bool[2]{false};
if (*n == false) cout << "false" << endl;
int *p=new int[10]();// The default initialization value is 04, While opening up memory, assign multiple different values
int *p=new int[5]{1,2,3,4,5};边栏推荐
- Construction and application of industrial knowledge atlas (3): commodity knowledge fusion
- Product manager experience 100 (XI) - Strategic Product Manager: model and methodology
- LeetCode报错及其解决方案
- MySQL startup options and configuration files
- 小程序毕设作品之微信校园洗衣小程序毕业设计成品(2)小程序功能
- Meshlab farthest point sampling (FPS)
- 小程序毕设作品之微信校园洗衣小程序毕业设计成品(1)开发概要
- eBPF/Ftrace
- Verilog's system tasks - $fopen, $fclose and $fddisplay, $fwrite, $fstrobe, $fmonitor
- Double material first!
猜你喜欢

egg-swagger-doc 图形验证码解决方案

eBPF/Ftrace

js将数组根据指定属性值分组成二维数组

Structural thinking

Is it still time to take the PMP Exam in September?

腾讯云联合中国工联院发布工业AI质检标准化研究成果加速制造业智能化转型

Keras deep learning practice - recommend system data coding

English grammar_ Personal pronoun

Use recyclerview to realize the left sliding menu of the list

Set up SSH key based authentication using putty
随机推荐
Using ebpf to detect rootkit vulnerabilities
Leetcode error reporting and its solution
Cesium region clipping, local rendering
PCL 常用操作
QT clipboard qclipboard copy paste custom data
Is it still time to take the PMP Exam in September?
Thinkphp+ pagoda operation environment realizes scheduled tasks
List map basic notes
Conditions and procedures of futures account opening
建议收藏,PMP应战篇(2)之易混淆知识点
Keras深度学习实战——推荐系统数据编码
Data enhancement in image processing
【C语言入门】ZZULIOJ 1021-1025
MySQL high availability practical solution MHA
Differences between shell environment variables and set, env, export
js回调函数(callback)
Egg swagger doc graphic verification code solution
SQL tutorial: introduction to SQL aggregate functions
JWT login expiration - automatic refresh token scheme introduction
在“元宇宙空间”UTONMOS将打开虚实结合的数字世界