I want to change an CONST function pointer after it's initialed, I tried the following, i printed the pointer address copyed by memcpy, the address is different from the function address. Also, I get a seg fault on executing it. How can i do this?
const void (*function_pointer)(void)=NULL;
memcpy(&function_pointer, &function, sizeof(fuction_pointer));
fprintf(stderr, "%p, %p\n", &function_pointer, &function);