The void pointer is a pointer to anything. This is a generic pointer that does not have a specific type. It may also matter NULL, in which case it does not indicate anything. To use the void pointer, you must keep track of what it actually points to, and when you intend to use it, you must apply it to the appropriate type.
They can be dangerous, because if you apply it to the wrong type, it will lead to undefined behavior at runtime.
source
share