Sunday, January 10, 2010

What does the following program print?

#include

void main()
{

static struct S1
{
char c[4], *s;
} s1 = {"abc", "def"};

printf("%c %c\n", s1.c[0], *s1.s);
printf("%s %s", s1.c, s1.s);
}

a) Compiler error

b) a def
    abc def

c) a d
    abc def

d) a d
    a def


No comments: