json-tutorial icon indicating copy to clipboard operation
json-tutorial copied to clipboard

tutorial3 void*

Open skywhat opened this issue 8 years ago • 1 comments

void* ret;
ret = c->stack + c->top;
return ret;

为什么要用无类型指针呢,不是可以根据c->stack确定ret是char *

skywhat avatar Dec 16 '17 22:12 skywhat

char* 也可以。 后来会压入字符以外的数据,void* 表示指向任意类型的数据。

miloyip avatar Dec 17 '17 02:12 miloyip