For what it's worth, I managed to solve this closing VS removing the .vs folder and running VS again. Other times it just stopped the same way it appeared: no code changes, no build, just one debugging session is ok, the next one it stops in the 1st printf. It happens with boost calls to (stream_type::write() -> logging system) too, so I suspect "someone" (SO, antivirus?) is not letting VS to write anything out... just guessing.
It happens to me in visual studio 2022 too (using 2019 compilers, I have both VS installed).