Vidyalelo
C Programming · Q136

File Input Output

Programming · C Programming · question 136

Q136

Why do we write (int *) before malloc? int *ip = (int *)malloc(sizeof(int));

A.
It is for the syntax correctness
B.
It is for the type-casting
Answer
C.
It is to inform malloc function about the data-type expected
D.
None of the mentioned

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board