string class (字符串類的設計,帶指針的class)

包括內容: 深度拷貝:類中指針所指向的區域 需要拷貝 new:先分配memory,再調用構造函數 delete:先調用析構函數,再釋放memory 動態分配內存 堆、棧的區別 內存分配方式的可視化(release and debug) big three:拷貝構造、拷貝賦值、析構函數 new/delete配合使用,注意加 [ ]   代碼: mystring.h #ifndef STRING_H
相關文章
相關標籤/搜索