I have to use void**
in a program. I am writing the following code. please guide me where I am wrong.
struct kdnode
{
kdnode* lch;
int k;
void **dataptr;
kdnode* rch;
};
then I am assigning
kdnode rt;
rt.dataptr=new void*[k];
rt.dataptr[0]=new int;
there was also this dereferencing involved:
*(rt->dataptr[0])=n; //n is an initialized integer value.
basically I want to assign the elements of the array of void pointers to pointers of different datatypes. As the compiler is throwing error :
void*
is not a pointer-to object type
Please guide me what to do.