0

I'm working on a very small C++ console application using only VSCode and the command line. (I do not have access to the full Visual Studio on the machine I'm using.)

When an assertion occurs, I get a dialog like this:

enter image description here

Is there any way to make this debug information appear in the console, instead of the dialog box?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
AlfredBr
  • 1,281
  • 13
  • 25

1 Answers1

5

Add this to main()

_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );

And take a look at the docs for CrtSetReportMode.

AlfredBr
  • 1,281
  • 13
  • 25