(I want to deal with “void” I am avoid “template class” because it is too much trouble)
ok establish some ground
int aa=3;
int bb=4;
int cc=0;
int *a, *b, *c;
a = &aa;
b = &bb;
c = &cc;
*c = *a +*b; //yields 7
but I want to do the following:
void *va;
void *vb;
void *vc;
va = a;
vb = b;
*c = (int)(*va + *vb); // <-- 3 errors see below
but I get errors:
error C2100: illegal indirection
error C2100: illegal indirection
error C2110: cannot add two pointers
You can’t dereference
voidpointer.If you want to turn them into
int*you should do that before dereferencing;But you better be more specific, what exactly you want to do that you call “the following”.