Struct + member Function
With objects of a class, the default assignment operator does not make the two objects the same object, it only copies values of member variables from one object to another object.
We should use CPP Reference Type to use same object
If a class has a data member that points to dynamic memory
- Destructor
- Copy Constructor
- Member assignment (=) operator
- can be assign same
- remove original data
- Returns reference for chaining
CPP Class Features
Create Class Object(Instance)
C++ 객체생성 두가지 방법과 의문점(new를 이용한 동적할당객체)
처음 클래스를 배우면서 객체를 생성할 때 메모리를 동적으로 할당받지 않고(new를 사용하지 않고) 객체를 생성하였다. 클래스이름 객체이름; ex> Student kim; new 연산자를 사용한 동적할당. 클래스이름 *객체이..
https://multithread.tistory.com/entry/C-%EA%B0%9D%EC%B2%B4%EC%83%9D%EC%84%B1-%EB%91%90%EA%B0%80%EC%A7%80-%EB%B0%A9%EB%B2%95%EA%B3%BC-%EC%9D%98%EB%AC%B8%EC%A0%90new%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-%EB%8F%99%EC%A0%81%ED%95%A0%EB%8B%B9%EA%B0%9D%EC%B2%B4


Seonglae Cho