I need to convert an array an place it in a struct that has a void* element and back to another array:
unsigned short array[size];
//do something to the array
typedef struct ck{
void * arg1;
void * arg2;
void * arg3;
} argCookie;
argCookie myCookie;
myCookie.arg2=malloc(sizeof(array));//alloc the necessary space
memcpy(myCookie.arg2,&array,sizeof(array));//copy the entire array there
//later....
unsigned short otherArray[size];
otherArray=*((unsigned short**)aCookie.arg2);
It happens that this last line won't compile... Why is that? obviously I've messed up somewhere...
Thank you.