I have a weird problem with my function pointer
This won't workCode:void (*test)(void)=0; void SetPointer(int pointer) { test=pointer; }![]()
I recieve this:
'=' : cannot convert from 'int' to 'void (__cdecl *)(void)'
This is a discussion on Hassle with function pointers within the C++ Programming forums, part of the General Programming Boards category; I have a weird problem with my function pointer Code: void (*test)(void)=0; void SetPointer(int pointer) { test=pointer; } This won't ...
I have a weird problem with my function pointer
This won't workCode:void (*test)(void)=0; void SetPointer(int pointer) { test=pointer; }![]()
I recieve this:
'=' : cannot convert from 'int' to 'void (__cdecl *)(void)'
Use
Code:void SetPointer(void (*ptr)()) { test = ptr; }
It works! thx.