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
- 백준
- 문자열
- string
- Deep Learning
- Class
- 포인터
- pointer
- 배열
- predictive analysis
- 티스토리챌린지
- Python
- Data Science
- 파이썬
- vscode
- Object Oriented Programming
- baekjoon
- 오블완
- 반복문
- Pre-processing
- const
- assignment operator
- raw data
- array
- C++
- OOP
- 함수
- programming
- pass by reference
- 알고리즘
- 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 |