分类：电脑/网络-程序设计
问题：比较a.txt和b.txt文件的不同，将b.txt中有而a.tx? 
比较a.txt和b.txt文件的不同，将b.txt中有而a.txt中无的行记录到c.txt文件并求取
回答：#include <std.h> #include <stdlib.h> FILE *fin, *fout; void main(int argc, char * argv[]) { int i,j,k; char namein[32]="a.txt"; char nameout[32]="b.txt"; int buff_size = 1024; char *buff; buff = (char *) malloc(buff_size * sizeof (char)); if ( (fin = fopen(namein,"r") ) == NULL ) { printf("\007Cann't open input file: %s ", namein);exit(1); }; if ( (fout = fopen(nameout,"w") ) == NULL ) { printf("\007Cann't open output file: %s ", nameout);exit(1); }; while ( fgets(buff,buff_size,fin) !=NULL){ fprintf(fout,"%s",buff); } fclose(fin); fclose(fout); printf("\007Output in %s\n",nameout); exit(0); }