Home / C Programming / Pointers :: Discussion

Discussion :: Pointers

  1. What will be the output of the program?

    #include 
     int main() 
     {     
        int arr[3] = {2, 3, 4};  
        char *p;    
        p = arr;   
        p = (char*)((int*)(p));          
        printf("%d, ", *p);  
        p = (int*)(p+1);   
        printf("%d", *p);    
        return 0;
     } 
    

  2. A.

    2, 3

    B.

    2, 0

    C.

    2, Garbage value

    D.

    0, 0

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment