public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] C programming use of isascii(), ispunct() and isblank() fails
@ 2006-10-05 21:10 Kevin O'Gorman
  2006-10-06  0:04 ` Boyd Stephen Smith Jr.
  2006-10-06  0:53 ` Boyd Stephen Smith Jr.
  0 siblings, 2 replies; 12+ messages in thread
From: Kevin O'Gorman @ 2006-10-05 21:10 UTC (permalink / raw
  To: gentoo-user

Why is it that using some of the macros from ctype.h fails to compile?
In particular, the three mentioned in the subject: line.

Try this:

#include <stdio.h>
#include <ctype.h>

int main(int argc, char *argv[])
{
    int i;
    for (i = 0; i < 256; i++) {
        printf("%3d: ",i);
        if (isalpha(i)) printf(" alpha");
        if (isalnum(i)) printf(" alnum");
        if (isascii(i)) printf(" ascii");
        if (isblank(i)) printf(" blank");
        if (iscntrl(i)) printf(" cntrl");
        if (isdigit(i)) printf(" digit");
        if (isgraph(i)) printf(" graph");
        if (islower(i)) printf(" lower");
        if (isprint(i)) printf(" print");
        if (ispunct(i)) punctf(" punct");
        if (isspace(i)) printf(" space");
        if (isupper(i)) printf(" upper");
        if (isxdigit(i)) printf(" xdigit");
        printf("\n");
    }

    return 0;
}


-- 
Kevin O'Gorman, PhD
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-10-11  1:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 21:10 [gentoo-user] C programming use of isascii(), ispunct() and isblank() fails Kevin O'Gorman
2006-10-06  0:04 ` Boyd Stephen Smith Jr.
2006-10-06  0:53 ` Boyd Stephen Smith Jr.
2006-10-06  2:32   ` Kevin O'Gorman
2006-10-06  2:58     ` Mark Kirkwood
2006-10-06  3:19     ` Bo Ørsted Andresen
2006-10-06  4:49       ` Kevin O'Gorman
2006-10-06  4:55         ` Bo Ørsted Andresen
2006-10-06  5:00         ` Richard Fish
     [not found]         ` <200610060750.40927.bss03@volumehost.net>
2006-10-06 14:29           ` Arturo 'Buanzo' Busleiman
2006-10-06 14:31     ` Arturo 'Buanzo' Busleiman
2006-10-11  1:40       ` Zac Slade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox