카테고리 없음
Chapter 165. 객체의 동적 생성과 메모리 이해
사전지식: 1. dynamic allocation - Allocating Memory with new - http://devgraphy.tistory.com/7?category=810547 - Freeing Memory with delete - http://devgraphy.tistory.com/8?category=810547 Class 코드는 Section 164(http://devgraphy.tistory.com/11?category=810224)와 다른게 없다. 다만, main에서 object를 동적 할당하기 때문에 object 선언하는 부분만 다르다. int main() { Car* c1 = new Car; //dynamically create a class object cout speedUp()..
2018. 2. 22. 19:14