foreach not recognized in C++

前端 未结 9 1269
离开以前
离开以前 2021-01-21 08:07

In my the cs106b book we use the expression \"foreach\" to go through a list of words in a Map. I implemented the code and banged my head against the wall facing mysterious erro

9条回答
  •  一生所求
    2021-01-21 08:27

    The code in your example looks like a mix of C# and C++ syntax. The foreach construct itself is C# syntax, C++/CLI (supported by VC++) has a for each construct as does C++0x (supported by GCC 4.6), but neither followw that syntax.

提交回复
热议问题