Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!think!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!news From: flee@shire.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.c Subject: Another pitfall. Signed chars and ctype.h. Message-ID: Date: 7 Feb 90 22:15:50 GMT Sender: news@cs.psu.edu (Usenet) Organization: Penn State University Computer Science Lines: 12 If you have "char * s;" you cannot say something like "isdigit(*s)" if you want to be 8-bit clean. "isdigit" etc. take an (int) in the range [-1, UCHAR_MAX]. You have to say "isdigit((unsigned char) *s)". Or you could declare "unsigned char * s;" instead, but this is inconvenient since (char *) isn't compatible with (unsigned char *). This is only if your (char) is signed, but if you want to write portably you shouldn't assume unsignedness of (char). -- Felix Lee flee@shire.cs.psu.edu *!psuvax1!flee