Syntax of Void Pointer in C++

void* ptr_name;

As the type of data the void pointer is pointing to is unknown, we cannot dereference a void pointer.

void Pointer in C++

In C++, a void pointer is a pointer that is declared using the ‘void‘ keyword (void*). It is different from regular pointers it is used to point to data of no specified data type. It can point to any type of data so it is also called a “Generic Pointer“. 

Similar Reads

Syntax of Void Pointer in C++

void* ptr_name;...

Example of Void Pointer in C++

The below example demonstrates the declaration and use of void pointer in C++....

Application of Void Pointer in C++

...

Advantages of void Pointer in C++

1. Generic Coding...

Conclusion

...