且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C++ Interview - using new and delete to alloc and free memory

更新时间:2021-12-20 13:29:12

1. dynamic create object and initialization

int *pi = new int;   // pi points to an uninitialized int
int *pi = new int(); // pi points to an int value initialized to 0