home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 4.ddi / SAMPLES / PWBTUTOR / COUNTCH.C$ / COUNTCH
Encoding:
Text File  |  1991-08-12  |  572 b   |  27 lines

  1. // COUNTCH.C - Analyze a character.
  2. // Part of the multimodule example program used in the PWB tutorial.
  3. //
  4. // Increment Letters, Vowels, and/or Sentences if appropriate.
  5. //
  6.  
  7. #include <ctype.h>
  8. #include <string.h>
  9. #include "count.h"
  10.  
  11. void Analyze( char curChar, FLAG InWord )
  12. {
  13.     if( isalpha( curChar ) )
  14.     {
  15.         ++Letters;
  16.         if( strchr( "AEIOUaeiou", curChar ) ||
  17.             (strchr( "Yy", curChar ) && !InWord) )
  18.             ++Vowels;
  19.     }
  20.     else
  21.     {
  22.         if( strchr( ".!?", curChar ) )
  23.             ++Sentences;
  24.     }
  25.  
  26. }
  27.