c - Store address information -
c - Store address information -
i have question next code:
//definition of base of operations used in ptr void *base; int query(win *ptr, void *baseptr) { *(void**) baseptr = ptr->base; ... } can alter statement following?
baseptr = ptr->base; why cast baseptr void **?
looks baseptr used output parameter. caller of query() should looks like:
void *base = null; win *win = something; int result = query(win, &base); then, base in caller function may assigned received value.
if write baseptr = ptr->base;, copy of base inside query() beingness updated. after query() returns, pointer in caller not updated @ all.
c
Comments
Post a Comment