How do you correctly use malloc()? I.E. without casts. I thought this was how:

Code:
int* data = malloc(sizeof(int) * 10);
But my compiler complains that it 'cannot convert void* to int*', so I'm forced to use a '(int*)' cast.

Oh yeah, and when do I use each of reinterpret_cast, static_cast and const_cast?