C++
[C++] 범위기반 for문(ranged-based for statement)
심심231
2019. 10. 14. 10:43
범위기반 for문(ranged-based for statement)
for (element_declaration : array)
statement
루프는 각 array의 요소를 반복하여 element_declaration에 선언된 변수에 현재 배열 요소의 값을 할당.
최상의 결과를 얻으려면 element_declaration이 배열 요소와 같은 자료형이어야 함
참고
https://boycoding.tistory.com/210
728x90
반응형