voidpointer
A void pointer, written as void*, is a pointer type used in C and C++ that can hold the address of any object but does not have a specified data type. Because it has no type, a void* cannot be dereferenced directly or used in pointer arithmetic without first converting to a pointer to a concrete type.
In C, a void* acts as a generic object pointer. It can hold addresses of objects of
In C++, void* is also used as a generic pointer, but conversions between void* and other object
Common uses of void* include implementing generic data structures and APIs, such as buffers, opaque handles,
Limitations and pitfalls include the risk of incorrect casts, alignment issues, and violations of object lifetimes
Example: void* p = malloc(sizeof(int)); *(int*)p = 42; free(p);