일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- C++
- C언어 포인터
- c#
- 포인터
- 깃
- Algorithm
- gitlab
- jupyter
- github
- vim
- Houdini
- 구조체
- 도커
- Data Structure
- Python
- Unity
- 다트 언어
- dart 언어
- c# 추상 클래스
- HTML
- 유니티
- C# delegate
- git
- jupyter lab
- c언어
- 플러터
- c# 윈폼
- c# winform
- Flutter
- docker
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