C++ For Each Loop | Range Based For Loop in C++ | Enhanced For Loop in C++

preview_player
Показать описание
C++ For Each Loop | Range Based For Loop in C++ | Enhanced For Loop in C++

Find Program Code in following link:
Рекомендации по теме
Комментарии
Автор

Learn & Get Udemy Certificate for this course "Learn C++ Programming - Beginner to Advanced". Check following link:
Watch more videos on C++ programming in following link:

Comrevo
Автор

Hi sir, why I cannot use for each loop in a function?no matter what size I set for the function input array, it still gives out errors
e.g.
void test(int a[3]);

int main(){



int list[3];
for (int i=1;i<=3;i++){
list[i-1]=i;
}
// for (int i : list){
// cout<<i<<"\n";
// }

test(list);

return 0;

}
void test(int a[3]){

for (int i : a){
cout<<i<<"\n";
}
}

餃子-ug
Автор

plz use dark theme ...this is lil disturbing as it is not the vs code🥲🥲🥲🥲

nextrealm