CPP Class

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2020 Jun 21 9:11
Editor
Edited
Edited
2023 Apr 25 17:22

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 연산자를 사용한 동적할당. 클래스이름 *객체이..
C++ 객체생성 두가지 방법과 의문점(new를 이용한 동적할당객체)
 
 

Backlinks

C Grammar

Recommendations