c++ - What does static void (* __set_malloc_handler(void (*__f)()))() mean
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-05 11:11:30
0
1
987
static void (* __set_malloc_handler(void (*__f)()))()

void (*func)()I understand this, but what does the above __f do, and how to call the above function?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
巴扎黑

Disassemble the analysis layer by layer
The innermost __f is a function pointer, its parameter is void, and the return value is void.
Then __set_malloc_handler is relatively easy to confuse. First of all, it is a function (I said it wrong at first, not a pointer). Its parameters are function pointers in the shape of __f, and its return value is a pointer. The type of this pointer is void. (*)()
The usage should be as follows:

void (*foo)();
void (*bar)();
foo = __set_malloc_handler(bar);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template