// function for title case, from 27 March 2012 class // Lin Jensen for CSC 116 void titlecase (char* str) { char c, d; int isletter, state = 0; // initial state no word found while (c = *str) { d = c|0x20; isletter = d >= 'a' && d <= 'z'; if (!state && isletter) { state = 1; // a word is now started *str = c & 0xDF; // make first letter uppercase } if (state==1 && c==' ') state = 0; // done with a word // else nothing to do str++ ; // point to next letter } return; }