【发布时间】:2023-03-10 00:36:01
【问题描述】:
我试图通过命令“watch a”来观察“int a”的变化。但是程序并没有停止,当它变为 12 时。为什么?
/* FILE: test.c */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv){
printf("Hello world\n");
int a = 12;
a = 10;
return 0;
}
【问题讨论】:
-
您是否使用调试信息(-g)进行编译并且您确定您使用的是调试版本?