From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-user+bounces-52480-garchives=archives.gentoo.org@gentoo.org>) id 1GVab1-0000Lg-14 for garchives@archives.gentoo.org; Thu, 05 Oct 2006 21:17:35 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.6) with SMTP id k95LFBpT030280; Thu, 5 Oct 2006 21:15:11 GMT Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.238]) by robin.gentoo.org (8.13.8/8.13.6) with ESMTP id k95LAkxj017940 for <gentoo-user@lists.gentoo.org>; Thu, 5 Oct 2006 21:10:46 GMT Received: by wx-out-0506.google.com with SMTP id r21so864728wxc for <gentoo-user@lists.gentoo.org>; Thu, 05 Oct 2006 14:10:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=BJtkLwE7mwqkMltEqfO66l/cvGMDCnPunLbi0v8W/wVkYqt4BHoK0BLDAt6i/4wbLnxUyH3VjElC+N01Yt0jlPach0BqCC2Pf2Fx8iO5fWJCXLEXT+57WfzivQaSD8vk63i2X+pKsqsisTnNSzbiQklNk6JrnKkp6z6MhOs2+b0= Received: by 10.90.119.15 with SMTP id r15mr1359321agc; Thu, 05 Oct 2006 14:10:45 -0700 (PDT) Received: by 10.90.102.12 with HTTP; Thu, 5 Oct 2006 14:10:45 -0700 (PDT) Message-ID: <9acccfe50610051410u44292b4ava0e58d6289ad73fa@mail.gmail.com> Date: Thu, 5 Oct 2006 14:10:45 -0700 From: "Kevin O'Gorman" <kogorman@gmail.com> To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] C programming use of isascii(), ispunct() and isblank() fails Precedence: bulk List-Post: <mailto:gentoo-user@lists.gentoo.org> List-Help: <mailto:gentoo-user+help@gentoo.org> List-Unsubscribe: <mailto:gentoo-user+unsubscribe@gentoo.org> List-Subscribe: <mailto:gentoo-user+subscribe@gentoo.org> List-Id: Gentoo Linux mail <gentoo-user.gentoo.org> X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Archives-Salt: 7e46caea-aae1-468b-88be-292a8a38f12c X-Archives-Hash: 755011f19c445a9b8ea48b5b05e8d40b 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