标签:存储 color 动态 col 类类型 ptr ble 地址 动态内存
数组的动态内存分配
double* pdata = new double[20]; delete [] pdata; /*此处必须加 []*/
pdata = nullptr; /*设置为空指针*/
通过指针存储类类型对象的地址
#include <vector> int main() { std::vector<int>* pdata = new std::vector<int>{};
delete pdata;
pdate = nullptr;
return 0; }
标签:存储 color 动态 col 类类型 ptr ble 地址 动态内存
原文地址:https://www.cnblogs.com/rivsidn/p/9323097.html