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

Welcome



Your comments will be displayed only after manual approval.