#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<ctype.h>
unsigned char xx[50][80];
int maxline=0;
int readdat(void);
void writedat(void);
void encryptchar( )
{int i;
char *pf;
for(i=0;i<maxline;i++)
{pf=xx[i];
while(*pf!=0)
{ if(*pf%2==0||*pf*11%256<=32);
else
*pf=*pf*11%256;
pf++; }
}
main( )
{
clrscr( );
if(readdat( ))
{
printf("eng9.in can not open\n\007");
return;
}
encryptchar( );
writedat( );
}
int readdat(void)
{
FILE *fp;
int i=0;
unsigned char *p;
if((fp=fopen("eng9.in","r"))==NULL) return 1;
while(fgets(xx[i],80,fp)!=NULL)
{p=strchr(xx[i],'\n');
if(p) *p=0;
i++;
}
maxline=i;
fclose(fp);
return 0;}
void writedat(void)
{FILE *fp;
int i;
fp=fopen("ps9.dat","w");
for(i=0;i<maxline;i++)
{
printf("%s\n",xx[i]);
fprintf(fp,"%s\n",xx[i]);}
fclose(fp);
}
}
顺便请大侠解释一下这几句是啥意思?while(fgets(xx[i],80,fp)!=NULL)
{p=strchr(xx[i],'\n');
if(p) *p=0;
i++;
}
我不懂的就是*P为啥要让他等于0呢?