GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — programming-c-cpp-learning/memory at master · eeyoo/programming-c-cpp-learning Expand file tree/ Copy pathmemory/Directory actionsMore optionsMore optionsDirectory actionsMore optionsMore options/ Copy pathmemory/Folders and files
动态内存 ======= 两种类型: 栈 在函数内声明所有变量将占有栈内存 堆 程序中为声明的变量,可能在运行中占有的内存 new 和 delete运算符 ------------------- new 用于请求内存空间,与malloc()方法相比,new可以创建对象。 delete 用于释放new分配的内存空间(尽管c++支持内存自动清理,手动释放占有空间依然推荐) 数组内存动态分配 --------------- 二维数组 new array[len]; delete [] array; 多维数组 new array[len][len]; delete [] array; 对象内存动态分配(自定义数据类型) -------------------------- | |||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | |||||||||||||||||||||||||||||||||||||||||