ls的挺好用 不过我的vc不能编译 稍微修改下
#include<stdio.h>
#include<conio.h>
int main(int argc, char** argv)
{
FILE *fp;
char ch;
char havecharflag=0;/*????±ê???????????????????ò??×?·??ò??*/
if(argc != 2)
{
printf("Usage: argv[0] filename\n");
}
fp=fopen(argv[1],"r");
if(fp==NULL)
/*???????????????ò??????????*/
{
printf("Can't open the file");
getch();
exit(0);
}
/*???·?±???????á??*/
while(!feof(fp))
{
ch=fgetc(fp);
/*???ò??×?·?*/
if(ch>=32 && ch<=126)
{
printf("%c",ch);
/*±ê???±?°???????ò??×?·??ò????*/
if(!havecharflag)
havecharflag=1;
}
else
{
/*±ê???±?°?????????ò??×?·??ò??*/
if(havecharflag)
{
/* printf("\n"); */
havecharflag=0;
}
}
}
getch();
return 0;
}