From owner-freebsd-questions@FreeBSD.ORG Sun Oct 16 23:15:30 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 103421065674 for ; Sun, 16 Oct 2011 23:15:30 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id C8FE18FC13 for ; Sun, 16 Oct 2011 23:15:29 +0000 (UTC) Received: from r56.edvax.de (port-92-195-40-141.dynamic.qsc.de [92.195.40.141]) by mx02.qsc.de (Postfix) with ESMTP id 35E841E823; Mon, 17 Oct 2011 01:15:28 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id p9GNFRAC003616; Mon, 17 Oct 2011 01:15:27 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 17 Oct 2011 01:15:27 +0200 From: Polytropon To: Gary Kline 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> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: need to check for hex in C: how/ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2011 23:15:30 -0000 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, ...