Share via

crt_dbg1 Sample: C Run-Time Basic Debugging Features

The crt_dbg1 sample illustrates the basic debugging features of the C run-time libraries and the kind of debug output that these features generate.

Security noteSecurity Note

This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.

To get samples and instructions for installing them:

To access samples from Visual Studio

  • On the Help menu, click Samples.

    By default, these samples are installed in drive:\Program Files\Microsoft Visual Studio 10.0\Samples\.

  • For the most recent version of this sample and a list of other samples, see Visual Studio Samples on the MSDN Web site.

Building and Running the Sample

To build and run this sample

  1. Open crt_dbg1.sln.

  2. On the Build menu, click Build.

  3. On the Debug menu, click Start Without Debugging.

  4. To see the output of the program as it progresses, set breakpoints in the code and then view the output in the command window for the program. Or, run Debug\crt_dbg1.exe at a command prompt.


This sample uses the following keywords:

_asserte; _crtcheckmemory; _crtdumpmemoryleaks; _crtmemcheckpoint; _crtmemdifference; _crtmemdumpallobjectssince; _crtmemdumpstatistics; _crtsetdbgflag; _crtsetreportfile; _crtsetreportmode; _malloc_dbg; _rpt1; _rpt2; aboutbox; clear_crt_debug_field; createinstance; displaystring; free; get_size; helpstring; id; iid_is; malloc; module; outputheading; pointer_default; put_size; set_crt_debug_field; strcmp; strcpy_s; uuid

See Also

Other Resources

General Samples