Home / CSE MCQs / C-MCQs :: Pointers - C

CSE MCQs :: C-MCQs

  1. What substitution should be made to //-Ref such that ptr1 points to variable C?

    int main()
    {
    int a = 1, b = 2, c = 3;
    int *ptr1 = &a;
    int **sptr = &ptr1;
    //-Ref
    }
  2. A.
    *sptr = &c;
    B.
    **sptr = &c;
    C.
    *ptr1 = &c;
    D.
    None of the mentioned.

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of the following declaration throw run-time error?
  4. A.
    int **c = &c;
    B.
    int **c = &*c;
    C.
    int **c = **c;
    D.
    None of the mentioned.

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Comment on the output of this C code?

    int main()
    {
    int a = 10;
    int **c -= &&a;
    }
  6. A.
    You cannot apply any arithmetic operand to a pointer.
    B.
    We don't have address of an address operator
    C.
    Both (a) and (b)
    D.
    None of the mentioned.

    View Answer

    Workspace

    Discuss Discuss in Forum