Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    struct Employee
    {
    char *ch;
    };
    void main()
    {
    struct Employee e;
    struct Employee *s = &e;
    (*s).ch = "Interview Mania";
    printf("%p\n%p\n", s, &e);
    }
    1. Interview Mania
    2. Different memory address
    3. Same memory address
    4. Compilation Error
    5. None of these
Correct Option: C

Same memory address



Your comments will be displayed only after manual approval.