0 0 votes Programming in C programming-in-c + – teja1521 2.2k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply manisha11 commented Feb 17, 2019 reply Follow flag malloc returns a void pointer (void *), which indicates that it is a pointer to a region of an unknown data type. The use of casting is required in C++ due to the strong type system, whereas this is not the case in C 1 1 replyShare smsubham commented Feb 17, 2019 reply Follow flag malloc()or calloc() returns void * which can be assigned to any pointer type .In C it's not necessary to typecast the void* since it's implicitly done by compiler.But in c++ it will give you error if you won't typecast Source: https://stackoverflow.com/questions/13287888/is-it-necessary-to-type-cast-malloc-and-calloc 1 1 replyShare Please log in or register to add a comment.