• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

C++ Equivalent to the C# 'foreach' Loop

C# C++
foreach (string s in StringList) //C++11:
for (std::string s : StringList)

//prior to C++11, the conversion is unpleasant (assuming a vector of std::string):
for (std::vector<std::string>::const_iterator s = StringList.begin(); s != StringList.end(); ++s)

Use C# to C++ Converter to convert from C# to C++.     

Additional resource: C++ and C# Equivalents

Copyright © 1997 – 2017 Tangible Software Solutions Inc.