:: Re: [DNG] [OT] [Re: Studying C as t…
Top Page
Delete this message
Reply to this message
Author: Adam Borowski
Date:  
To: dng
Subject: Re: [DNG] [OT] [Re: Studying C as told. (For help)
On Tue, Jun 21, 2016 at 05:55:52PM +0100, KatolaZ wrote:
> On Tue, Jun 21, 2016 at 06:41:15PM +0200, Edward Bartolo wrote:
> > And
> > << if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) >>
> >
> > would reduce to:
> >
> > if (isletter(c))
>
> or, you could just use "isalpha(c)", as suggested also by Urban.


Bad idea, it's non-portable. I don't know about isalpha() in particular,
but quite recently I met a hard to debug bug on Solaris on isspace(). Its
implementation returns bogus values for bytes with the high bit set, not
even the same on every call for the same input.

--
An imaginary friend squared is a real enemy.