What will be the output of the following C code? [code] #include <stdio.h> int main() { int i = 10; int *p

Hưng Thịnh

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    int main()
    {
        int i = 10;
        int *p = &i;
        foo(&p);
        printf("%d ", *p);
        printf("%d ", *p);
    }
    void foo(int **const p)
    {
        int j = 11;
        *p = &j;
        printf("%d ", **p);
    }
A. 11 11 11
B. 11 11 Undefined-value
C. Compile time error
D. Segmentation fault/code-crash
 

Tìm kiếm

Back
Top