看板 EE_DSnP 關於我們 聯絡資訊
它call了 freeArr 這個function 裡頭的要求是這樣: // 1. Get the array size 'n' stored by system, // which is also the _recycleList index 雖然從.ref中可以很直觀地想說delete掉多大的array size 那個size的空間就會丟入recycleList中 不過感覺好有點本末倒置!?(謎) 那這邊的這個地方 跟memTest這class中的deleteArr中的idx有沒有關係? 附一下code... void deleteArr(size_t idx) { assert(idx < _arrList.size()); delete _arrList[idx]; _arrList[idx]=0; } (也就是本文第五行的n跟idx有關係嗎?) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.235
ric2k1:沒有關係哦! 提示: _arrList[idx] 仍然是個 array 哦! 04/27 17:22