Answers for "for auto loop in c++"

C++
0

for auto c++

for (auto&& [first,second] : mymap) {
    // use first and second
}
Posted by: Guest on October-14-2021
-1

c++ auto loop

for(auto x: myVector){
	cout<< x << " ";
}
Posted by: Guest on April-25-2021
-1

iterate over a range in c++

for (int i=0; i<5; ++i) {
  cout << i << " ";
}
// output is 0 1 2 3 4; note 5 is excluded since < is used and not <=
Posted by: Guest on September-13-2020

Browse Popular Code Answers by Language