Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. Why do we write (int *) before malloc?
         int *ip = (int *)malloc(sizeof(int));
  2. A.
    It is for the syntax correctness
    B.
    It is for the type-casting
    C.
    It is to inform malloc function about the data-type expected
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    None.


Be The First To Comment