摘要: 先看一段代码:int main(void) { int *pI = new int; int *pArray = new int[10]; int size = *(pArray-1); delete pI; delete [] pArray; // delete是如何知道pArray数组大小的? return 0; } 看反编译后代码,没能直接找到答案,于是在网上搜索发现这样一篇文章:《Mismatching scalar and vector new and delete》。文章中说明了内存布局大概是这样:这个结论肯定是正确的,但是我却没能在内存中找到这个记录数组大小的地址。再看... 阅读全文
posted @ 2013-10-31 23:59 natata 阅读(2589) 评论(0) 推荐(0) 编辑