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

※ 본 포스트는 코드누리 C++ Basic 강의 내용을 보고 정리한 포스트입니다. 1. Copy Constructor- 자신과 동일한 타입 한개를 인자로 가지는 생성자class Point{ int x; int y;public: Point() : x{0}, y{0} {} // 1 Point(int a, int b) : x{a}, y{b} {} // 2};int main(){ Point p1; // ok. Point p2(1,2); // ok// Point p3(1); // error. Point(int) 필요 Point p4(p2); // ok. Point(Point)}- Point p4(p2);와 같은 생성자는 만든적이 없음에도 이상없이 잘 작동한다. ※ 복사 생성자를 만들..
C++/Basic
2024. 8. 19. 22:36