need to check for hex in C: how/

Polytropon freebsd at
Sun Oct 16 23:15:30 UTC 2011

On Sun, 16 Oct 2011 16:06:54 -0700, Gary Kline wrote:
> this will bbe my 'sanity-checck' of sorts.  the ck function will
> have something like:
> if ((char)x == 'a')
> {
> }

I'm not sure this is required. Many functions that deal with
characters (in this case: letters) do operate on (int) instead
of (char). For example getc() and getchar(), but also getch()
from NCurses do so. It's common to simply compare those (int)
value to character constants without casting them to (char)
before comparison.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list