// // Convert binary file to header (include) file // // #include #include int main(int argc,char *argv[]){ unsigned int filesize,count; unsigned char c; FILE *in,*out; if((in=fopen(argv[1],"rb"))==NULL){ printf("could not open infile !\n"); exit(1); } if((out=fopen(argv[2],"wb"))==NULL){ printf("could not open outfile !\n"); exit(1); } // bepaal lengte van infile if(fseek(in,0,SEEK_END)!=0){ printf("seek error\n"); exit(1); } filesize=ftell(in); printf("filesize: %d",filesize); fseek(in,0,SEEK_SET); // give header fprintf(out,"char %s[]={",argv[3]); for(count=0;count