Examveda

Comment on the output of the following C code.
#include <stdio.h>
struct temp
{
    int a;
    int b;
    int c;
};
main()
{
    struct temp p[] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
}

A. No Compile time error, generates an array of structure of size 3

B. No Compile time error, generates an array of structure of size 9

C. Compile time error, illegal declaration of a multidimensional array

D. Compile time error, illegal assignment to members of structure

Answer: Option A


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union