http://www.geeksforgeeks.org/g-fact-12-2/
C allows a void* pointer to be assigned to any pointer type without a cast, whereas C++ does not; this appears often in C code using malloc memory allocation. For example, the following is valid in C but not C++:
1 void* ptr; 2 int *i = ptr; /* Implicit conversion from void* to int* */
or similarly:
1 int *j = malloc(sizeof(int) * 5); /* Implicit conversion from void* to int* */
In order to make the code compile in both C and C++, one must use an explicit cast:
1 void* ptr;2 int *i = (int *) ptr;3 int *j = (int *) malloc(sizeof(int) * 5);
Source: