generic function pointer c++ code example
Example: c++ generic pointer
void* gp; //generic pointer
int* ip; //int pointer
char* cp; //char pointer
gp = ip; //legal conversion
ip = static_cast<int*>(gp); //explicit cast required
//in C++ but not in C
cp = ip; //illegal conversion
*ip = 15; //legal dereference of pointer to int
*ip = *gp; //illegal generic pointer dereference