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