home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 412.lha / crabs / merge.c < prev    next >
C/C++ Source or Header  |  1990-08-29  |  556b  |  30 lines

  1. /*
  2. **  This program will read two bitmap file for exactly the 
  3. **  same format and create a or'd version on standard output
  4. ** 
  5. **  This use is to merge rotated crabs to find the minimal mask
  6. */
  7.  
  8. #include <stdio.h>
  9.  
  10. main(argc, argv)
  11.  int argc;
  12.  char *argv[];
  13. {
  14.   char c1, c2;
  15.   FILE *file;
  16.  
  17.   if( (file = fopen(argv[1], "r")) == NULL ) {
  18.     fprintf(stderr,"Can't open the argument file\n");
  19.     exit(1);
  20.   }
  21.   
  22.   while( (c1=getchar()) != EOF && (c2=getc(file)) != EOF ) {
  23.     if( c2=='*' )
  24.       c1='*';
  25.     putchar(c1);
  26.   }
  27.   fclose(file);
  28.   return 0;
  29. }
  30.