This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0. 관습적으로 아무 생각 없이 키보드만 두들기지 말고, | |
내가 적는 라인을 메모리 할당의 측면과, 컴파일&런타임 측면에서 생각하며 코딩하기. | |
1. 힙에 할당되었던 메모리가 delete로 해제되었다고 하더라도, 포인터는 여전히 해당 메모리주소의 값을 저장하고 있음. | |
int* k; | |
k = new int(5); | |
int* d = k; |