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

C++ Equivalent to the VB For Each Loop

VB C++
For Each s As String In StringList
    ...
Next s
//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 VB to C++ Converter to convert from VB to C++.     

Additional resource: VB.NET and C++ Equivalents


Copyright © 1997 – 2018 Tangible Software Solutions, Inc.