Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

visual studio code - VSCode: can't figure out Hit Count condition

This should be such an easy question to answer. I'm a bit of a newbie to Visual Studio Code and I'm struggling to work out how to get the "Hit Count" conditional breakpoint feature to work. I've got a simple for loop set up like this:

for (int i = 0; i < 10; i++)
{
  cout << i << endl;
}

I put a breakpoint on the cout line, right-clicked it and clicked "Edit Breakpoint..." and changed the drop-down box to "Hit Count". I want to simply have the breakpoint fire on the 5th iteration through the for loop, but I can't figure out how to write the expression. No matter what I write, the program breaks at the first pass through the loop. I've tried "5", "== 5" and "Hit Count == 5" but nothing works.

enter image description here

If anyone could tell me what I'm doing wrong, I'd be grateful! All the stuff I can find online is about Visual Studio and not VSCode.

question from:https://stackoverflow.com/questions/65873190/vscode-cant-figure-out-hit-count-condition

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...