home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume2 / linksrc / binary.c next >
Encoding:
C/C++ Source or Header  |  1991-08-07  |  277 b   |  30 lines

  1. /*
  2.  * See if a file is Ascii or not.
  3.  *
  4.  * Keyword: binary file status
  5.  */
  6.  
  7. #include <stdio.h>
  8. main()
  9. {
  10. int ii, jj, kk;
  11.  
  12. kk = 0;
  13.  
  14. for (ii=0; ii < 100; ii++)
  15. {
  16. if ( (jj = getchar()) == EOF )
  17.     {
  18.     break;
  19.     }
  20.  
  21. if (jj == 0 || jj > '~')
  22.     {
  23.     kk = 1;
  24.     break;
  25.     }
  26. }
  27.  
  28. printf("%d\n",kk);
  29. }
  30.