It is usually easier to debug an application that was built with the -g
flag, which is used by default in Debug configurations.
From the Run menu, choose "Debug" In the window that opens, you would
typically choose a project under C/C++ Local Application in the left-hand
pane. In the right pane are tabs for choosing which version of the
executable to use, supplying arguments, setting environment variables,
choosing a debugger, and setting a search path for source files.
When all of your choices have been made, press the debug button at the bottom
of the window. Unless you have chosen otherwise, the program will stop
before executing the first statement. Breakpoints can be set by clicking
on lines in the source code view. Icons in the toolbar directly above
the "Debug" status pane can be used for stepping or running the program to the
next breakpoint. The icons also have menu and keyboard equivalents.
There is a pane in the upper right for viewing variables and output appears in
the pane at the bottom.