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 |
Tags
- 반복문
- 오블완
- programming
- 알고리즘
- Python
- Object Oriented Programming
- array
- baekjoon
- 백준
- predictive analysis
- Deep Learning
- raw data
- 파이썬
- 티스토리챌린지
- C++
- Pre-processing
- 문자열
- 배열
- Class
- const
- pointer
- vscode
- string
- OOP
- assignment operator
- 함수
- pass by reference
- Data Science
- 포인터
- function
Archives
- Today
- Total
Channi Studies
[C++] Range-based for Loop 본문
형식
// FORMAT
for (var_type var_name: sequence){
statements; // can use var_name
}
예시 코드
// Example Code
#include <iostream>
using namespace std;
int main(){
vector<int> my_vec {10, 50, 22, 501, 1930};
for (int num:my_vec) {
cout << num << endl; // 10\n50\n22\n501\n1930
}
}
'C++ > 반복문 (Loop)' 카테고리의 다른 글
[C++] do-while Loop (0) | 2023.12.12 |
---|---|
[C++] While Loop (0) | 2023.12.10 |
[C++] Conditional Operator (조건 연산자) (2) | 2023.12.08 |