Trivial C question: iterating through chars
Many of your questions may have already been answered in earlier discussions or in the FAQ. The search results page will indicate current discussions as well as past list serves, articles, and papers.
Walter B. Ligon III walt at clemson.eduFri Apr 20 10:08:24 PDT 2001
- Previous message: Trivial C question: iterating through chars
- Next message: Finding the largest double/float (non-"infinite") number...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
--------
Chris,
I'm not sure if you are more interested in ASCII or in C programming.
My suggestion is you try "man ascii" which will give you a complete
listing. otherwise, printable ascii runs from 32 to 126 decimal:
char c;
for (c = 32; c < 127; c++)
printf("Ascii %d is %c\n", c, c);
or you could try:
int i;
for (i = 0; i < 10000; i++)
{
if (isprint(i))
printf("Ascii %d is %c\n", i, i);
}
which will give you all sorts of stuff that isn't ascii, but is technically
"printable" - I only tested to 10000, but there are probably more printables
above that. I suppose you could go to MAXINT.
Walt
--
Dr. Walter B. Ligon III
Associate Professor
ECE Department
Clemson University
- Previous message: Trivial C question: iterating through chars
- Next message: Finding the largest double/float (non-"infinite") number...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Beowulf mailing list
