-
c++ 2d array range-based for loop아무거나적어~ 2023. 1. 4. 12:37123456789101112131415#include <iostream>using namespace std;int main(){int a[3][2]{};for (int* p : a){ // auto p: a 쓰면 정신건강에 좋음for (int i = 0; i < 2; i++){cout << p[i] << ' '; // cout << *(p+i) << ' '; 이것도 됨}}return 0;}cs
'아무거나적어~' 카테고리의 다른 글
python 의 매력 (0) 2023.01.06 c언어의 매력 (0) 2023.01.06 python template (0) 2023.01.03 c++ vs python (0) 2022.12.31 수열 규칙 찾아주는 사이트 (0) 2022.12.23