Home » C Programming » Typedef » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    typedef struct Employee
    {
    char *ch;
    }Employ;
    void main()
    {
    struct Employee emp;
    emp.ch = "Welcome";
    printf("%s", emp.ch);
    }
    1. Welcome
    2. Compilation Error
    3. Garbage value
    4. Undefined behaviour
    5. None of these
Correct Option: A

Welcome



Your comments will be displayed only after manual approval.