Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    struct Employee
    {
    char *ch;
    struct Employee *point;
    };
    void main()
    {
    struct Employee e1;
    struct Employee *e2 = &e1;
    printf("%d", sizeof(Employee));
    }
    1. Undefined behaviour
    2. Nothing
    3. Garbage value
    4. Compilation Error
    5. None of these
Correct Option: D

Compilation Error

main.c: In function ‘main’:
main.c:11:29: error: ‘Employee’ undeclared (first use in this function)
printf("%d", sizeof(Employee));
^~~~~~~~
main.c:11:29: note: each undeclared identifier is reported only once for each function it appears in



Your comments will be displayed only after manual approval.