일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 code
- html id
- html youtube
- html object
- #C++ has~a
- #1차원배열
- #성적관리프로그램
- mac terminal command
- border-box
- #bubbleSort
- hyperledger transaction
- html plug-in
- #2차원배열
- #JAVASCRIPT
- html5 new tag
- relative path
- 토큰경제
- html charset
- 하이퍼레저패브릭
- #3차원배열
- #binary
- git flow
- html video
- #자바상속#자바이즈어#is~a
- #다차원포인터
- html multimedia
- #CallByAddress
- #android activity
- docker example
- #C++ 연산자함수오버로딩
Archives
- Today
- Total
목록#C++ friend (1)
A sentimental robot
Friend
friend 단점: 캡슐화가 파괴될 위험이 있다. 장점: 코드의 확장 1. class 2. member function 잘 안쓰임 3. function 제일 잘 쓰인다. function 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 #include using namespace std; class A { int a; public: friend void disp(); }; void disp() { A aa; aa.a = 100; // A클래스에서 friend로 선언했기 때문에 A의 private int a에 접근가능 ; 캡슐화 파괴 cout
C++
2018. 9. 19. 13:33