Foreach loop in C++ equivalent of C#

前端 未结 11 1739
礼貌的吻别
礼貌的吻别 2020-12-13 01:20

How would I convert this code to C++?

string[] strarr = {\"ram\",\"mohan\",\"sita\"};    
foreach(string str in strarr) {
  listbox.items.add(str);
}
         


        
11条回答
  •  温柔的废话
    2020-12-13 02:20

    Boost has a macro that will do this for you.

    http://www.boost.org/doc/libs/1_44_0/doc/html/foreach.html

提交回复
热议问题