Define and access Character Arrays - C String

C examples for String:char array

Description

Define and access Character Arrays

Demo Code

#include <stdio.h>

int main (void)
{
    char word[] = {'H', 'e', 'l', 'l', 'o', '!'};
    int i;/*w ww.j a va2  s  . c  om*/

    for (i = 0; i < 6; ++i)
        printf ("%c", word[i]);

    printf ("\n");

    return 0;
}

Result


Related Tutorials