1.

What are void pointers?

Answer»

A VOID pointer is a pointer which is having no datatype associated with it. It can HOLD ADDRESSES of any TYPE.

For example-

void *ptr; char *str;p=str; // no error str=p; // error because of type mismatch

We can ASSIGN a pointer of any type to a void pointer but the reverse is not true unless you typecast it as

str=(char*) ptr;


Discussion

No Comment Found