Inspecting STL containers in Visual Studio debugging

前端 未结 10 1391
旧巷少年郎
旧巷少年郎 2020-12-05 06:52

If I have a std::vector or std::map variable, and I want to see the contents, it\'s a big pain to see the nth element while debugging. Is there a p

10条回答
  •  余生分开走
    2020-12-05 07:40

    If you want to watch more than one element at the same time, you can append a comma and the number of elements as so:

    (v._Myfirst)[startIndex], count

    However, note that count must be a constant, it cannot be the result of another expression.

提交回复
热议问题