카테고리 없음
[C++] 지정 초기화를 통한 struct의 초기화와 대입 연산
지정 초기화( designated initializer )다음과 같은 구조체를 초기화할 때, 여러 데이터 멤버를 한 번에 초기화할 수 있는 초기화 리스트( initializer list )는 편리합니다. [C++] 구조체( struct )와 같은 집합체( aggregate )의 초기화집합체( aggregate )의 초기화집합체( aggregate )란 여러 개의 데이터 멤버를 갖고 있는 타입( type )을 말합니다. 다음은 이러한 집합체 해당하는 struct 타입의 예입니다.struct Date{ // 집합체 int year; int mcodingbonfire.tistory.com#include #include struct Date{ int year; int month{ 1 }; ..
2025. 1. 12.