A void* pointer can be assigned to any type of pointers - C++ Data Type

C++ examples for Data Type:Pointer

Description

A void* pointer can be assigned to any type of pointers

Demo Code

int main() {/*from www.j a  v a 2  s. com*/
   void* vp;
   char c;
   int i;
   float f;
   double d;
   // The address of ANY type can be
   // assigned to a void pointer:
   vp = &c;
   vp = &i;
   vp = &f;
   vp = &d;
}

Related Tutorials