LINUX下的哑口无言,很奇怪的编译问题
程序代码:
#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #define maxlen 100 void charge(char argv[],int n) { int i; for(i=0;i<n;i++) argv[i]=argv[i]+16; } void xxx(int fd,int fd1,char buff[],int maxlen) //编译器提示这个地方缺少“;” 或者 “,”或者“)”,我的脑袋彻底被颠覆了,发生了什么? { int n; while((n=read(fd1,buff,maxlen))>0){ if(n!=maxlen){ charge(buff,n); if(write(fd,buff,n)!=n){ printf("xie ru shuju shibai"); exit(0); } } else{ charge(buff,maxlen); if(write(fd,buff,maxlen)!=maxlen){ printf("xie ru shuju shibai"); exit(0); } } if(n<0) printf("du shibai"); } } int main() { int fd; int fd1; int fd2; char buff[maxlen]; int n; if((fd=open("kle.txt",O_RDWR))==-1) printf("open fail\n"); if((fd1=open("readme.txt",O_RDONLY))==-1) printf("readme.txt open faile!!\n"); if((fd2=open("mmt.txt",O_RDWR|O_CREAT))==-1) printf("open fail\n"); xxx(fd,fd1,buff,maxlen); printf("xieruchenggong\n"); exit(0); }