functioning C implementation of the CharTable