*(char**) how to understand this construct?
- by House.Lee
recently, while reading former's code in my current project, I encounter the problems below:
while implementing the Queue, my former wrote codes like this:
while(uq->pHead)
{
char *tmp = uq->pHead;
uq->pHead = *(char **)tmp;
//...
}
the uq-pHead has definition like:
typedef struct {
char* pHead;
//...
} Queue;
Well, I'm quite confused about the usage that "uq->pHead = *(char**)tmp" , could anyone explain it to me in detail?
if we assume that *(uq-pHead) = 32(i.e. ' ') , *(char**)tmp would translate this into pointer-form, but...how could it make sense?
Thanks a lot.