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

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 

 

 

posted @ 2014-07-08 10:11  Master HaKu  阅读(157)  评论(0编辑  收藏  举报