正在加载图片...
Extent(cont) u Also We could leverage the Dynamic Extent Use the new and delete operators in any functions a Its memory was allocated from the free store Manually memory management by the programmer Example int* funcAO void funcB(int* p) nt*p=new int[ 1024] cout <<pl l<<endl return p deletepExtent (cont.) ◼ Also we could leverage the “Dynamic Extent” ◼ Use the new and delete operators in any functions ◼ Its memory was allocated from the free store ◼ Manually memory management by the programmer ◼ Example int* funcA() void funcB(int* p) { { int* p = new int[1024]; cout << p[ 1 ] << endl; return p; delete [] p; } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有