🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #47184

Free isalpha utility (final version)

#47184
From: Thomas J. Boschloo
Date: Sun, 01 Dec 2002 11:04
59 lines
3638 bytes
Hi all, I coded this little utility to test which value isalpha()
returns for each possible character fed into it. Due to the huge respect
I have developed for both Richard Heathfield (ANSI C coder supreme) and
Phil Carmody (expert on every character set and ISO standard relating to
that), I thought I would proof them right when they told me to use the
ANSI C function isalpha() to check for 'extended' ascii characters that
might also be letters (though with accents most of the time).

To avoid them the trouble of actually checking their facts first I coded
this little ANSI C program for them (well, it is near ANSI, but I hope
you two clowns can manage):

------- isalpha.c ------
#include <stdio.h>
#include <ctype.h>
#include <limits.h>

void main(void)
{
	int i;

	printf("Printing characters for which isalpha(character) is true"
		" from %i to %i\n", 0, UCHAR_MAX);
	for(i=0; i<=UCHAR_MAX; i++)
		if(isalpha(i))
			printf("%3i=%c\t", i, (unsigned char)i);
	printf("\nLoop stopped at value %i\n", i);
}
------ end isalpha.c ------

And here is the curious output both my ANSI C compilers produce for it
after compilation (Turbo C 2.01 and lcc-win32 version 3.8):

----- output -----
Printing characters for which isalpha(character) is true from 0 to 255
 65=A    66=B    67=C    68=D    69=E    70=F    71=G    72=H    73=I   74=J
 75=K    76=L    77=M    78=N    79=O    80=P    81=Q    82=R    83=S   84=T
 85=U    86=V    87=W    88=X    89=Y    90=Z    97=a    98=b    99=c  100=d
101=e   102=f   103=g   104=h   105=i   106=j   107=k   108=l   109=m  110=n
111=o   112=p   113=q   114=r   115=s   116=t   117=u   118=v   119=w  120=x
121=y   122=z
Loop stopped at value 256
----- end output -----

So what is going on guys? Why all the missing stuff you said there would
be? Should I have used locale.h? If so, how do I use that because it
isn't present in Turbo C 2.01.

Please help me out guys, you have been so helpful in the past so I bet
you would help a poor soul that is eager to learn from you advanced
programmers on how to code this thing right.

Thanks guys, you're really swell,
Thomas J. Boschloo
Den Helder
-- 
Douglas Adams, 1978: "The Greek ferry timetables are the greatest work
of sublime fiction ever written this century".
T.J. Boschloo <home.hccnet.nl/t.j.boschloo>
Technical Details
Message-ID: <3DE9ECD3.5E4A0F79@hccnet.nl.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.security.pgp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!cleanfeed.casema.net!leda.casema.net!bnewspeer01.bru.ops.eu.uu.net!emea.uu.net!news.hccnet.nl!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <3DE9ECD3.5E4A0F79@hccnet.nl.invalid>
Subject: Free isalpha utility (final version)
Date: Sun, 01 Dec 2002 12:04:51 +0100
From: "Thomas J. Boschloo" <nospam@hccnet.nl.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.security.pgp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!cleanfeed.casema.net!leda.casema.net!bnewspeer01.bru.ops.eu.uu.net!emea.uu.net!news.hccnet.nl!not-for-mail
Newsgroups: sci.crypt,alt.privacy.anon-server,alt.fan.cult-dead-cow,alt.security.pgp
Organization: Hobby Computer Club News Network
Lines: 60
NNTP-Posting-Host: uds14-35.dial.hccnet.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.hccnet.nl 1038740997 9463 62.251.35.14 (1 Dec 2002 11:09:57 GMT)
X-Complaints-To: abuse@hccnet.nl
NNTP-Posting-Date: Sun, 1 Dec 2002 11:09:57 +0000 (UTC)
Cancel-Lock: sha1:emA4x9b+/R0IFJ7E6qgXNFHbDPs=
X-Mailer: Mozilla 4.8 [en] (Win98; U)
X-Accept-Language: en,nl,de
X-NFilter: 1.2.1-b1