foreach loop for c++ | SoloLearn: Learn to code for FREE!


foreach loop for c++

Is there a loop in C++ like foreach loop in C#?

11/17/2017 3:30:17 PM

Mustafa K.

3 Answers

New Answer


Yes, there is. Its called for_each(). The C++ one uses iterators and a function, but cannot accept the container the iterators point to, unlike the C# version.