# Debugging your project

The debugger lets you control the execution of your program by setting breakpoints, suspending executed programs, stepping through your code, and examining the contents of variables.

To debug a project:

1. Click Run > Debug.

   The Debug dialog box opens.

2. Double-click C++ Local.
3. In the Name box, type Hello World.

You can now select this debug launch configuration by name the next time that you debug this project.

4. In the C/C++ Application box, type hello.exe.
5. Click Debug.

You will now see the debug perspective with the hello.exe application window open. The C/C++ editor is repositioned in the perspective.

6. In the left margin of the main.cpp window, double-click to set a breakpoint on:
   cout << "You just entered"
7. Click Run > Resume.
8. When prompted, type a value other than 'm'.
   The breakpoint will be hit.
9. In the Variable view, verify that the variable is not 'm'.
10. Click Run > Resume.
11. When prompted, type a value other than 'm'.

The breakpoint will be hit.

12. In the Variable view, verify that the variable is not 'm'.
13. In the Variable view, right-click the input variable, and select Change Variable Value and type 'm'.
14. Click Run > Resume.

The output in the hello.exe application window is:
"You just entered m, you need to enter m to exit."

15. Type 'm' to end the program.
    The hello.exe application window closes and the debug session ends. The debug perspective remains open.

To learn more about the debug aids at your disposal, refer to the related debug conceptual topics.

Back: Building your project

Debug overview
Debug information

Debugging

Debug view
Debug launch controls