How to free an array in C/C++ [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . int main() { // Will this code cause memory leak? // Do I need to call the free operator? // Do I need to call delete? int arr[3] = {2, 2, 3}; return 0; } Does this code create a memory leak? Where does arr reside? On the stack or in RAM? 回答1: In this program int main() { // Will