Why do we write (int *) before malloc?
Posted: Wed Jul 13, 2022 7:54 pm
int *ip = (int *)malloc(sizeof(int));
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
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