An example of void pointer
#include <iostream>
using namespace std;
class temp
{
int num;
public:
temp(){num=10;}
void * getNum(void){return ((void *) &num);}
void setNum(void * myNum){int * thisNum=(int *) myNum; num=*thisNum;}
};
int main()
{
temp A;
int mainnum= *(int *) A.getNum();
int * n;
int i=30;
n= &i;
A.setNum((void *) n);
mainnum= *(int *) A.getNum();
return 0;
}