C++動態內存分配

C++動態內存分配 C語言:malloc()/free() C++中:new/delete 運算符 new運算符用於動態內存的分配,delete運算符用於動態內存的釋放。 C語言:       int *p = (int*)malloc(sizeof(int));       *p = 100;       free(p); C++:       int *p = new int(200);   
相關文章
相關標籤/搜索