Home » C Programming » Storage Classes » Question
  1. Why do we write (int *) before malloc?
    int *ip = (int *)malloc(sizeof(int));
    1. It is to inform malloc function about the data-type expected
    2. It is for the syntax correctness
    3. It is for the type-casting
    4. All of above
    5. None of these
Correct Option: C

It is for the type-casting



Your comments will be displayed only after manual approval.