Do you have your compiler's warnings turned on? This shouldn't go by unnoticed:


if ( isalpha ( word ) )

isalpha() expects an int, not a char *.