|
发表于 2003-12-30 19:04:36
|
显示全部楼层
[code:1]
#include<stdio.h>
main (int argc,char *argv[])
{
int i1,i2;
char tmp[500]="";
printf("\n版本:0.8.0B\n");
printf("\n刚输入的文件名为:\n\"%s\"\n",argv[0]);
//i1=0;i2=argc;
i1=1;i2=argc-1;
//while(argc>=1)
while(argc>=2)
{
strcat(tmp,argv[i1]);
i1++;
strcat(tmp,"\n");
argc--;
}
printf("\n除了本文件名,总共接收到%d组参数,参数如下\n%s\n",i2,tmp);
}
[/code:1] |
|