Search posts, tags, users, and pages
Patchouli
工程師帕秋莉~
前言 考慮以下函數: int Calculate(int n) { int *arr1 = new int[n]; int *arr2 = new int[n]; delete[] arr1; delete[] arr2; return n+1; } 看起來很好,在一開始 new 的陣列在離開函數時都釋放掉了。 但是其實會有問題的:
Markdown supported · ⌘↵ to post
No responses yet.