Example Program

As an example, you may set up the indicated program, which contains an out-of-range array error, an oversized structure cast error, and a premature delete error.

  1. Create a Win32 Console Application project named ConsoleExe. (Do not create a Win32 Application. ConsoleExe uses standard I/O, which requires a DOS window.)
  2. Copy the example program code into ConsoleExe.cpp in place of the existing main program.
  3. Compile and link the ConsoleExe application with the compiler options /Od /Oi.
  4. At this point, you have three alternatives: (a) Run it from the command line and attach WinDbg to it as it waits for input; (b) start it from WinDbg; or (c) use the /debug WinDbg.exe option to bring up the debugger on an error.

    You can then observe how the various heap debug options affect the behavior of the program and that of the debugger.



 

 

This Help system was created using a trial version of Adobe RoboHelp. Files generated with the trial version are intended for evaluation purposes only and may not be used or distributed for any other purpose.