Sail E0 Webinar
Question
Why do we write (int *) before malloc?    
int *ip = (int *)malloc(sizeof(int));
Options:
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
Answer: Option B


None.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers