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 | 29 | 30 | 31 |
Tags
- const
- predictive analysis
- 백준
- raw data
- 함수
- 배열
- array
- Python
- assignment operator
- OOP
- C++
- vscode
- 파이썬
- pointer
- Deep Learning
- function
- Class
- 반복문
- Object Oriented Programming
- 알고리즘
- 문자열
- 오블완
- 티스토리챌린지
- programming
- baekjoon
- string
- Data Science
- pass by reference
- Pre-processing
- 포인터
Archives
- Today
- Total
목록overloading (1)
Channi Studies
[C++] 생성자 초기화 리스트 (Constructor Initialization List), 생성자 오버로딩
C++에서 객체를 생성할 때, 대입 연산자를 사용하지 않고 리스트의 형식으로 초기화 하는 방법이 존재합니다. 이를 우리는 생성자 초기화 리스트 라고 부릅니다 예시를 보여드리겠습니다. class Player { private: string name{}; int health{}; int xp{}; public: // Constructor Player(string name_val, int health_val, int xp_val); }; Player::Player(string name_val, int health_val, int xp_val) : name{name_val}, health{health_val}, xp{xp_val} {} 하지만 입력하는 사람이 모든 값을 입력하지 않을 수 있기 때문에 우리는 오버..
C++/객체지향 프로그래밍 (OOP)
2023. 12. 28. 17:11