//////////////////////////////////////////////////////// // // stringstuff.cpp // // Started 1/5/97 by Jeff Ondich // Last modified: 1/5/97 // // Some dumb string-related utilities. This program // is really being used to illustrate the use of // separate files for interface and implementation. // //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// // // Returns the number of vowels contained in the // given null-terminated character string. Y's // are not considered vowels for this function. // //////////////////////////////////////////////////////// int VowelCount( char *str ) { int count = 0; for( int i=0; str[i] != '\0'; i++ ) { if( str[i] == 'a' || str[i] == 'A' || str[i] == 'e' || str[i] == 'E' || str[i] == 'i' || str[i] == 'I' || str[i] == 'o' || str[i] == 'O' || str[i] == 'u' || str[i] == 'U' ) { count = count + 1; } } return( count ); }