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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -