|
查看: 1245|回复: 6
|
C Programming : 怎样Pause Execution来看Output?
[复制链接]
|
|
|
如题.
我的Code:-
#include
int main(int argc, char *argv[])
{ int i,j;
int *p;
if (argc > 1)
i = atoi(argv[1]);
else
{ fprintf(stderr, "usage: %s .\n", argv[0]);
exit(1);
}
p = &i;
j = *p + 2;
*p = j / 2;
printf("i = %d\n",i);
printf("j = %d\n",j);
printf("*p = %d\n",*p);
exit(0);
}
麻烦了,抱歉. |
|
|
|
|
|
|
|
|
|
|
发表于 4-11-2010 06:17 PM
|
显示全部楼层
|
put scanf(); before exist(0); |
|
|
|
|
|
|
|
|
|
|
发表于 4-11-2010 06:17 PM
|
显示全部楼层
|
put scanf(); before exist(0); |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 4-11-2010 06:28 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 4-11-2010 06:57 PM
|
显示全部楼层
不能哦....................
bryanliau91 发表于 4-11-2010 06:28 PM 
put 1 more scanf in front of exit(1) also....please remember to set variable for scanf.
when the program run, it will stop at scanf and wait for your input. Before you input, the exit(0) and exit(1) will not run. so the program pause. |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 4-11-2010 07:14 PM
|
显示全部楼层
回复 5# Reader
yes, before the input, i can see the execution.
but i want see the execution of output oo. |
|
|
|
|
|
|
|
|
|
|
发表于 4-11-2010 07:19 PM
|
显示全部楼层
|
use break point lahh..... |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|