To debug a program, it is necessary to pause the program, portionly display some information on the screen and then continue working again on command (this is for debugging, visualization of some data is displayed, so braitpoint, etc. will not help).
At first I used _getch() to stop and start, but after the first stop and start, the program second time _getch() ignored and stopped only at the third, the fourth ignored, stopped at the fifth, etc.
Then I replaced _getch() with std::in >> value , but the situation is even _getch() there - the first std::in works, the following are ignored (the same for the std::in and _getch() - after the first std::in everything else is being played).
Tell me what could be the matter?
I most likely had a recording outside the allocated memory (I am looking for it) - can this lead to such results? Or am I calling something wrong?
PS
The code is too big to extract some self-contained, playable piece from it, but the call looks like this:
void myfunc() { std::cout << std::endl; show_debug(true, position); std::cout << std::endl; _getch(); myfunc(); // у меня вложенные вызовы, но не глубокие (глубина до 4) } even if you do this:
std::cout << std::endl; std::cout << '*' << std::endl; _getch(); will be played by 2 *
Pps
I noticed that in DEBUG such a problem disappears (just flowing somewhere!)
_getch()what do you click? Not any of the extended keys (well, there, the arrow, F-some, etc.)? Very much like that ...std::in- do you meanstd::cin? What mode are you working in? In general, would you show a minimal, self-sufficient and reproducible example ... - Harrystd::cin, thenyadded a piece of code to the main post, but it is unlikely that it will show - Zhihar_getch, like this:while(_kbhit()) _getch();- acade