1. 把“生成调试信息”设置为 Yes。方法如下:
Tools(工具) --> Compiler Options(编译器选项) --> Settings(设置)

2. 编译程序。请参考:
Dev-C++ 安装&使用教程
Dev-C++ 编译多文件程序的方法
3. 设置断点(Break point)
把光标移动到您想暂停执行的那一行,按 ctrl + F5,或者直接用鼠标点击下图红线标明的区域。

4. 开始调试(Debug)
按 F8 开始调试。如果您没有把“生成调试信息”设置为 Yes,Dev-C++ 会提示说您的工程中没有调试信息。

点击 Yes,Dev-C++ 会自动把“生成调试信息”设置为 Yes,并且重新编译您的工程。程序运行到断点处会暂停:

按 F7 执行当前行,并跳到下一行:

ctrl + F7 跳到下一断点,shift + F4 跳到光标所在行,并在该行设置断点。
5. 查看变量的值
开始调试后,在图示区域按右键(如果您使用的是左手习惯,则是左键),选择“添加监测(Add Watch)”;或者直接按 F4。在弹出窗口中输入您想查看的变量名,然后按确定(OK),就可以看到该变量的值:


用鼠标选择源文件中的变量名,然后按 F4 也可以查看变量的值,该变量会出现在左边的监测列表中:

如果您在环境选项(Environment Options)中选择了“通过鼠标监测变量(Watch variable under mouse)”,用鼠标指向您想要查看的变量一段时间,该变量也会被添加到监测列表中。
重要提示:
1). 当您想查看指针指向的变量的值的时候,按 F4,然后输入星号及指针的名字(如 *pointer)。
如果没加 *,看到的将会是一个地址,也就是指针的值。
2). 有时,调试器(Debugger)可能不知道某个指针的类型,从而不能显示该指针指向的变量的值。
此时,我们需要手动输入该指针的类型。按 F4 后,以 *(type *)pointer 形式输入。例如,
*(int *)pointer。