C语言,用命令行参数复制文件,这代码哪里错了,怎么总是提示打不开

#include<stdio.h>#include<stdlib.h>intmain(intargc,char*argv[]){intch;errno_terr;FILE... #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int ch;
errno_t err;
FILE *source, *destination;
if ((err = fopen_s(&source, argv[1], "rb") )!=0)
{
printf("can't open %s\n", argv[1]);
exit(1);
}
if ((err = fopen_s(&destination, argv[2], "wb")) != 0)
{
printf("can't open %s \n", argv[2]);
exit(1);
}
while ((ch = getc(source)) != EOF)
putc(ch, destination);
fclose(source);
fclose(destination);
printf("copy finished\n");
return 0;
}
展开
 我来答
by...y@163.com
2015-12-05 · 超过19用户采纳过TA的回答
知道答主
回答量:62
采纳率:0%
帮助的人:14.9万
展开全部
C# 命令行参数
1.如果是csc.exe的,请自行用/?查看
2.如果指你要给你自己写的程序的,那么Main的()里的参数LIST就是你要

与一般字符串数组使用一样
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式