:: Re: [DNG] [OT] [Re: Studying C as t…
Etusivu
Poista viesti
Vastaa
Lähettäjä: Adam Borowski
Päiväys:  
Vastaanottaja: dng
Aihe: 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.