| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 631 人关注过本帖
标题:大家帮我下
只看楼主 加入收藏
qyzcx
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-6-21
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
大家帮我下
#include
main(argc,argv)
int argc;char *argv[];
{ FILE *fpw;
int c;
if ((fpw=fopen(argv[1],"w"))==NULL)
{
printf("can't creat %s\n",argv[1]);
exit(1);
}
while ((c=getchar())!=EOF)
fputc(c,fpw);
fputc(0x1a,fpw);
fclose(fpw);}


这个程序怎么运行?

上机实习步骤哦
2012-06-21 14:00
墨本无非
Rank: 1
等 级:新手上路
帖 子:11
专家分:7
注 册:2012-6-20
收藏
得分:4 
0040187C   int         3
0040187D   xor         eax,eax
0040187F   test        eax,eax
00401881   jne         _fsopen+9 (00401859)
00401883   mov         ecx,dword ptr [file]
00401886   movsx       edx,byte ptr [ecx]
00401889   test        edx,edx
0040188B   jne         _fsopen+5Bh (004018ab)
0040188D   push        offset string "*file != _T('\\0')" (004210a8)
00401892   push        0
00401894   push        36h
00401896   push        offset string "fopen.c" (004210bc)
0040189B   push        2
0040189D   call        _CrtDbgReport (00403e70)
004018A2   add         esp,14h
004018A5   cmp         eax,1
004018A8   jne         _fsopen+5Bh (004018ab)
004018AA   int         3
004018AB   xor         eax,eax
004018AD   test        eax,eax
004018AF   jne         _fsopen+33h (00401883)
004018B1   cmp         dword ptr [mode],0
004018B5   jne         _fsopen+85h (004018d5)
004018B7   push        offset string "mode != NULL" (00421098)
004018BC   push        0
004018BE   push        37h
004018C0   push        offset string "fopen.c" (004210bc)
004018C5   push        2
004018C7   call        _CrtDbgReport (00403e70)
004018CC   add         esp,14h
004018CF   cmp         eax,1
004018D2   jne         _fsopen+85h (004018d5)
004018D4   int         3
004018D5   xor         ecx,ecx
004018D7   test        ecx,ecx
004018D9   jne         _fsopen+61h (004018b1)
004018DB   mov         edx,dword ptr [mode]
004018DE   movsx       eax,byte ptr [edx]
004018E1   test        eax,eax
004018E3   jne         _fsopen+0B3h (00401903)
004018E5   push        offset string "*mode != _T('\\0')" (00421084)
004018EA   push        0
004018EC   push        38h
004018EE   push        offset string "fopen.c" (004210bc)
004018F3   push        2
004018F5   call        _CrtDbgReport (00403e70)
004018FA   add         esp,14h
004018FD   cmp         eax,1
00401900   jne         _fsopen+0B3h (00401903)
00401902   int         3
00401903   xor         ecx,ecx
00401905   test        ecx,ecx
00401907   jne         _fsopen+8Bh (004018db)
00401909   call        _getstream (00406530)
0040190E   mov         dword ptr [stream],eax
00401911   cmp         dword ptr [stream],0
00401915   jne         _fsopen+0CBh (0040191b)
00401917   xor         eax,eax
00401919   jmp         _fsopen+0E9h (00401939)
0040191B   mov         edx,dword ptr [stream]
0040191E   push        edx
0040191F   mov         eax,dword ptr [shflag]
00401922   push        eax
00401923   mov         ecx,dword ptr [mode]
00401926   push        ecx
00401927   mov         edx,dword ptr [file]
0040192A   push        edx
0040192B   call        _openfile (004061a0)
00401930   add         esp,10h
00401933   mov         dword ptr [retval],eax
00401936   mov         eax,dword ptr [retval]
00401939   pop         edi
0040193A   pop         esi
0040193B   pop         ebx
0040193C   mov         esp,ebp
0040193E   pop         ebp
0040193F   ret
fopen:
00401940   push        ebp
00401941   mov         ebp,esp
00401943   push        40h
00401945   mov         eax,dword ptr [mode]
00401948   push        eax
00401949   mov         ecx,dword ptr [file]
0040194C   push        ecx
0040194D   call        _fsopen (00401850)
00401952   add         esp,0Ch
00401955   pop         ebp
00401956   ret
--- No source file  ---------------------------------------------------------------------------------------------------------------------------------------
00401957   int         3
00401958   int         3
00401959   int         3
0040195A   int         3
0040195B   int         3
0040195C   int         3
0040195D   int         3
0040195E   int         3
0040195F   int         3
__chkesp:
00401960   jne         __chkesp+3 (00401963)
00401962   ret
00401963   push        ebp
00401964   mov         ebp,esp
00401966   sub         esp,0
00401969   push        eax
0040196A   push        edx
0040196B   push        ebx
0040196C   push        esi
0040196D   push        edi
0040196E   push        offset string "The value of ESP was not properl"... (004210e8)
00401973   push        offset string "" (004210e4)
00401978   push        2Ah
0040197A   push        offset string "i386\\chkesp.c" (004210d4)
0040197F   push        1
00401981   call        _CrtDbgReport (00403e70)
00401986   add         esp,14h
00401989   cmp         eax,1
0040198C   jne         __chkesp+2Fh (0040198f)
0040198E   int         3
0040198F   pop         edi
00401990   pop         esi
00401991   pop         ebx
00401992   pop         edx
00401993   pop         eax
00401994   mov         esp,ebp
00401996   pop         ebp
00401997   ret
00401998   int         3
00401999   int         3
0040199A   int         3
0040199B   int         3
0040199C   int         3
0040199D   int         3
0040199E   int         3
0040199F   int         3
2012-06-21 14:30
pauljames
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:千里冰封
威 望:9
帖 子:1555
专家分:10000
注 册:2011-5-8
收藏
得分:4 
你这个程序写完整了吗?编译通过了吗?

经常不在线不能及时回复短消息,如有c/单片机/运动控制/数据采集等方面的项目难题可加qq1921826084。
2012-06-23 20:04
shenzhijian
Rank: 2
等 级:论坛游民
帖 子:21
专家分:50
注 册:2012-6-23
收藏
得分:4 
LINUX下SHELL下gcc编译,然后命令行输入就OK,argv[1]就是你要打开文件的路径
2012-06-23 23:03
星112
Rank: 5Rank: 5
来 自:山西朔州
等 级:职业侠客
威 望:2
帖 子:94
专家分:342
注 册:2012-6-22
收藏
得分:4 
你的程序貌似还有问题,没贴完全吧
2012-06-23 23:23
xielei0806
Rank: 2
等 级:论坛游民
帖 子:36
专家分:28
注 册:2012-3-20
收藏
得分:4 
好长啊!
2012-06-24 00:12
快速回复:大家帮我下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012340 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved