Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of the code below?

    int main()
    {
    int i = 10;
    int *const p = &i;
    foo(&p);
    printf("%d\n", *p);
    }
    void foo(int **p)
    {
    int j = 11;
    *p = &j;
    printf("%d\n", **p);
    }
  2. A.
    11   11
    B.
    Undefined behaviour
    C.
    Compile time error
    D.
    Segmentation fault/code-crash

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    None.


Be The First To Comment