일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- HTML
- Houdini
- gitlab
- c# 추상 클래스
- Algorithm
- 다트 언어
- Data Structure
- git
- 구조체
- 포인터
- C# delegate
- C++
- dart 언어
- jupyter lab
- c#
- Unity
- Flutter
- C언어 포인터
- c# 윈폼
- docker
- github
- c# winform
- jupyter
- 도커
- 깃
- 유니티
- vim
- 플러터
- c언어
- Python
Archives
- Today
- Total
목록c++ protected (1)
nomad-programmer
[Programming/C++] 접근 제어 키워드 (public, protected, private)
접근 제어 키워드 public: 모든 곳으로부터의 접근 허용 protected: 자식 클래스의 멤버 함수로부터의 접근만 허용 private: 자신의 멤버 함수 외에는 접근 불가 다음 예제를 보며 이 키워드가 의미하는 바를 구체적으로 확인해보자. #include using namespace std; class Parent{ private: int priv; protected: int prot; public: int publ; }; class Child : public Parent { void AccessParents(){ int n; // 부모의 멤버에 접근 시도 n = prev; // 실패 n = prot; // 성공 n = publ; // 성공 } }; int main(int argc, const ch..
Programming/C++
2023. 1. 20. 01:33