void pointer represents the absence of data type, and hence can be used to point to data of any type. However, since the data type is unknown, there is no way to directly derreference the pointer. To do so, casting the pointer to a certain data type is needed beforehand.
Situations where void pointer is applicable:
Sometimes, to make a function accept data of different types, e.g. int, char, double, etc, one might use template. (Although overloaded function is an option, but the least efficient way). Another way for this purpose is to use void pointer.
void FunctionName(void* data, type param)
{
/* based on the second argument param, dereference the pointer data such that
the data can be processed in the desired way.
*/
}
Just a reminder:
Void pointer and null pointer should be distinguished as they do have different purposes of usage and functionality. The latter does have a pointer type, but does not pointing to any valid address of any data.