Skip to content

Instantly share code, notes, and snippets.

@Curookie
Last active October 14, 2018 03:01
Show Gist options
  • Save Curookie/d35d4a30b56e025b260fdf83e7bdd2c1 to your computer and use it in GitHub Desktop.
Save Curookie/d35d4a30b56e025b260fdf83e7bdd2c1 to your computer and use it in GitHub Desktop.
객체지향 OOP
프로그램의 구현 및 관리를 용이하게 하기 위해
연관있는 데이터들을 묶을 수 있는 문법적 장치로 등장.
C언어에서의 struct는 연관있는 데이터를 묶을 수 있기만 하지만 함수 선언 및 정의, 생성자 및 소멸자 선언 및 정의, 상속 구조를 할 수 없다.
하지만 C++에서의 struct는 class의 동작방식이 일치한다고 보면된다.
함수 선언 및 정의, 생성자 및 소멸자 선언 및 정의, 상속 구조를 사용할 수 있다.
C++ struct와 class의 차이점은 멤버의 접근 지시자의 차이가 있다.
즉, 구조체는 접근제어 지시자를 선언하지않으면 public 으로 클래스는 private로 선언된다는 것.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment