Comment on the output of the following C code. [code] #include <stdio.h> int main() { char *str = "This" //Line 1

Comment on the output of the following C code.
Code:
    #include <stdio.h>
    int main()
    {
        char *str = "This" //Line 1
        char *ptr = "Program\n"; //Line 2
        str = ptr; //Line 3
        printf("%s, %s\n", str, ptr); //Line 4
    }
A. Memory holding “this” is cleared at line 3
B. Memory holding “this” loses its reference at line 3
C. You cannot assign pointer like in Line 3
D. Output will be This, Program
 

Tìm kiếm

Back
Top