Question about void pointers.

Hello guys.
I would like to know what's the difference between this to statements.
1
2
3
4
5
6
7
void function_test(void *l)
{
	//Both works fine, so, what's the difference between them considering good programming practice?
	int *num = l;//This one.
	int *num = (int*)l;//And this one.
	printf("The number is: %d \n",*num);
}


Thank you!
In C there is no difference. In C++ the first one doesn't compile because conversion from void* to another pointer type is not implicit.
Topic archived. No new replies allowed.