Re: need to check for hex in C: how/

2011-10-17 Thread perryh
Matthew Seaman m.sea...@infracaninophile.co.uk wrote: '32/' is not any sort of syntax I've ever seen before to indicate hexadecimal. I suspect it's a typo, intending '32.' My fingers are forever mixing up slashes and periods, since the keys are adjacent (on a US/English keyboard, dunno about

need to check for hex in C: how/

2011-10-16 Thread Gary Kline
if n == 15 and x is the int. i can say if ((int)x == 15) Or to check if x == 'A' i can cast x to (char)x. what's the syntax to chec if x is , say, 32/ -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book:

Re: need to check for hex in C: how/

2011-10-16 Thread Robert Bonomi
From owner-freebsd-questi...@freebsd.org Sun Oct 16 16:27:46 2011 Date: Sun, 16 Oct 2011 14:26:31 -0700 From: Gary Kline kl...@thought.org To: FreeBSD Mailing List freebsd-questions@freebsd.org Cc: Subject: need to check for hex in C: how/ if n == 15 and x is the int. i can say if

Re: need to check for hex in C: how/

2011-10-16 Thread Polytropon
On Sun, 16 Oct 2011 14:26:31 -0700, Gary Kline wrote: if n == 15 and x is the int. i can say if ((int)x == 15) Or to check if x == 'A' i can cast x to (char)x. what's the syntax to chec if x is , say, 32/ The integer types are automatically casted, no matter if you compare (int) or

Re: need to check for hex in C: how/

2011-10-16 Thread Matthew Seaman
On 16/10/2011 22:26, Gary Kline wrote: if n == 15 and x is the int. i can say if ((int)x == 15) Or to check if x == 'A' i can cast x to (char)x. what's the syntax to chec if x is , say, 32/ In C code you can write an integer constant in hexadecimal by prefixing it with 0x -- so 0x32 is

Re: need to check for hex in C: how/

2011-10-16 Thread Gary Kline
On Sun, Oct 16, 2011 at 11:07:59PM +0100, Matthew Seaman wrote: Date: Sun, 16 Oct 2011 23:07:59 +0100 From: Matthew Seaman m.sea...@infracaninophile.co.uk Subject: Re: need to check for hex in C: how/ To: freebsd-questions@freebsd.org On 16/10/2011 22:26, Gary Kline wrote: if n == 15 and

Re: need to check for hex in C: how/

2011-10-16 Thread Gary Kline
On Sun, Oct 16, 2011 at 11:58:03PM +0200, Polytropon wrote: Date: Sun, 16 Oct 2011 23:58:03 +0200 From: Polytropon free...@edvax.de Subject: Re: need to check for hex in C: how/ To: Gary Kline kl...@thought.org Cc: FreeBSD Mailing List freebsd-questions@freebsd.org X-Mailer: Sylpheed 3.1.1

Re: need to check for hex in C: how/

2011-10-16 Thread Polytropon
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

Re: need to check for hex in C: how/

2011-10-16 Thread Robert Bonomi
Date: Sun, 16 Oct 2011 16:06:54 -0700 From: Gary Kline kl...@thought.org Subject: Re: need to check for hex in C: how/ this will bbe my 'sanity-checck' of sorts. the ck function will have something like: if ((char)x == 'a') { } And, you deserve what happens if you use that kind of