Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2011 01:15:27 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Gary Kline <kline@thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: need to check for hex in C: how/
Message-ID:  <20111017011527.e4d25568.freebsd@edvax.de>
In-Reply-To: <20111016230654.GB1112@thought.org>
References:  <20111016212628.GA30284@thought.org> <20111016235803.40b2181a.freebsd@edvax.de> <20111016230654.GB1112@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111017011527.e4d25568.freebsd>