问个问题
下面的程序,传递参数int argc有什么作用的阿?
#include <stdio.h>
main( int argc ,char *argv[])
{
FILE *fp;
int count=0;
if((fp=fopen(argv[1],"r"))==NULL)
{
printf("can not open file %s\n",argv[1]);
exit(0);
}
while(fgetc(fp)!=EOF)
count++;
fclose(fp);
printf("file %s contains %d characters ",argv[1],count);
getchar();
}
发表时间:2004年9月9日9:23:15