If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.
// 틀린 내용이 있을 수 있습니다. 발견하신 분은 지적해 주세요.
----------------------
Go to the U-City
----------------------------------------------------------------------------------------
Don't Feed the Trolls!
----------------------------------------------------------------------------------------
구조체도 사용자 정의 데이터 타입이기 때문에
배열을 구성할 수 있고, 배열 초기화의 원칙에 따라
명시된 배열 요소의 개수보다 초기값의 수가 적다면
나머지 부분은 0으로 자동 초기화 됩니다.
// 틀린 내용이 있을 수 있습니다. 발견하신 분은 지적해 주세요.
----------------------
Go to the U-City
----------------------------------------------------------------------------------------
Don't Feed the Trolls!
----------------------------------------------------------------------------------------
그게 표준이기는
그게 표준이기는 하지만 임베디드 장비에 포함되는 컴파일러에 구현이 안된 경우를 본 적이 있는 것 같습니다. 한 10년 전 쯤이라 지금은 잘 될지도 모르지요.
PC에 쓰이는 컴파일러에 구현 안되어있는 경우는 본 적은 없습니다.
------------------------------
How many legs does a dog have?
------------------------------
How many legs does a dog have?
댓글 달기