Home » C Programming » Pointers » Question
  1. Comment on the output of the following C code.
    #include <stdio.h>
    int main()
    {
    char *s = "Interveiw" //Line 1
    char *p = "Mania\n"; //Line 2
    s = p; //Line 3
    printf("%s, %s\n", s, p); //Line 4
    }
    1. Output will be Interveiw, Mania
    2. You cannot assign pointer like in Line 3
    3. Memory holding “this” is cleared at line 3
    4. Memory holding “this” loses its reference at line 3
    5. None of these
Correct Option: D

Memory holding “this” loses its reference at line 3



Your comments will be displayed only after manual approval.