Trivial C question: iterating through chars
per at computer.org
Fri Apr 20 14:50:25 PDT 2001
On Fri, 20 Apr 2001 12:29:00 -0300, Chris Richard Adams wrote:
>I'd like to view all the ASCII chars on my system. I tried:
>char ch = 'NUL';
char ch = 0;
>for ( i = 0; i < 500; i++)
> printf("Char: %c/n", ch + i");
One double-quote too many. Last one. And the /n should
be a \n instead.
>1.) What is illegal here?
>2.) Can I use chars in my for look also...something like:
>for ( ch = 'NUL; i < 500; ch++, i++)
for ( ch = 0: ch < 256; ch++, printf("Char: %d = %c\n", ch, ch));
More information about the Beowulf