佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1245|回复: 6

C Programming : 怎样Pause Execution来看Output?

[复制链接]
发表于 4-11-2010 05:31 PM | 显示全部楼层 |阅读模式
如题.

我的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);

}


麻烦了,抱歉.
回复

使用道具 举报


ADVERTISEMENT

发表于 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.
回复

使用道具 举报

Follow Us
发表于 4-11-2010 07:19 PM | 显示全部楼层
use break point lahh.....
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 18-11-2025 12:05 AM , Processed in 0.165755 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表