C语言实现文件信息统计

2024-10-13 17:13:51

1、首先打开VC++6.0

C语言实现文件信息统计

3、选择C++ source file 新建一个空白文档

C语言实现文件信息统计

6、主函数void main猾诮沓靥(int argc, char **argv ){int n=argc;if(argc<2)printf("Please input th髫潋啜缅e command: 43 file1 file2 ... filen");/*初始化全局变量*/charcount=0;wordcount=0;linecount=0;/*依次统计每个文件的信息*/while(--n>0)CountLWC(*(++argv));/*输出所有文件的统计信息*/if(argc>2){printf("\nThe information in all files is:\n");printf(">>Lines = %d\n",linecount);printf(">>Words = %d\n",wordcount);printf(">>Chars = %d\n",charcount);}getch();}

C语言实现文件信息统计
猜你喜欢