Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- vector capacity
- virtual inheritance
- base from member
- pointer to member data
- operator overloading
- std::cout
- std::endl
- member function pointer
- diamond inheritance
- vector size
- discord bot
- dynamic_cast
- virtual function table
- c++ basic practice
- suffix return type
- constructor
- placement new
- new&delete
- return by reference
- virtual destructor
- increment operator
- conversion constructor
- C++
- this call
- std::vector
- std::ostream
- 더 지니어스 양면포커
- c++ multi chatting room
- delete function
- virtual function
Archives
- Today
- Total
목록this call (1)
I'm FanJae.

1. this call 1-1. 멤버 함수의 의문점.class Point{ int x{0}; int y{0};public: void set(int a, int b) { x = a; y = b; }};int main(){ Point pt1; Point pt2; pt1.set(10, 20); pt2.set(10, 20);}- 멤버 데이터는 객체당 한 개씩 생성된다.- 멤버 함수는 코드 메모리에 한 개만 만들어져 있다. - 객체가 여러 개 생성되어도 멤버 함수는 한 개만 있다.※ 함수 인자는 2개 (a, b) 밖에 없는데, x가 어떤 객체의 멤버 인지(pt1.x인지 pt2.x 인지) 어떻게 아는가? 1-2. 어떤 변환이 일어나는가?clas..
C++/Intermediate
2024. 9. 22. 19:49