
Need Help with array...Please Advice
aHmING a crit dans le message ...
Quote:
>Let's say u have an array of char called
>char arrayofchar[30]
>how do u display the content of the array at the 20th location.
>I have tried this but it doesn't work.
>printf ("%s", arrayofchar[20]);
Sure. You have an array of char, so an element is a char. The correct
formatter (?) for printf() is "%c".
printf ("%c\n", arrayofchar[20]);
and don't forget to include <stdio.h>
--
-hs- "Stove"
CLC-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
ISO-C Library: http://www.dinkum.com/htm_cl
"Really? When run on my machine, a printed copy of the C FAQ leaps
from the monitor and whacks me over the head.." -- Chris Mears CLC