I'm trying out callback functions in C, and I'm not sure why, but for some reason printf does not work in the callback function. For example:
#include <stdio.h>
void call_this_method()
{
printf("call_this_method called\n");
}
void callback(void (*method))
{
printf("callback called\n");
(void) method;
}
int main(int argc, const char * argv[])
{
callback(call_this_method);
}
if I try to run this, only "callback called" gets printed out in the console; "call_this_method called" does not get printed out. Why is that?