The act of debugging helps the programmer to track "What went wrong logically?" in the program code.

Steps

  1. 1
    Type a C++ program in Turbo C++ editor.
  2. 2
    To add a breakpoint, follow these sub-steps:
    • Place the cursor at start of code where breakpoint needs to be placed
    • Go to Debug->Toggle Breakpoint. (Shortcut: Ctrl + F8).
    • A red highlight appears over the code.
    Advertisement
  3. 3
    Run the program. Use Run -> Run (Ctrl+F9).
    • The program run breaks where you have inserted breakpoint with a blue highlight.
  4. 4
    Press F8 (Step Over)/F7 (Trace Into).
  5. 5
    Add watches (Shortcut:Ctrl+F7) to the print value of any variable during execution.
  6. 6
    Done. This way you can easily debug through the code. Happy debugging!
  7. Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 48,315 times.
How helpful is this?
Co-authors: 6
Updated: December 8, 2020
Views: 48,315
Advertisement