Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Employee
    {
    char str[];
    };
    void main()
    {
    struct Employee Emp;
    printf("%d", sizeof(struct Employee));
    }
    1. Garbage value
    2. Undefined behaveiour
    3. Nothing
    4. Size of char
    5. Compilation Error
Correct Option: E

Compilation Error

main.c:4:14: error: flexible array member in a struct with no named members
char str[];



Your comments will be displayed only after manual approval.