I was surprised to find the first two assignments seem to be equivalent - what's going on?
#include "stdio.h"
static int foo() {
return 3;
}
int main(int argc, char** argv){
void* fp1 = foo;
void* fp2 = &foo;
printf("fp1 is %p\n", fp1);
printf("fp2 is %p\n", fp2);
}
Sample output:
fp1 is 0x100fd2f70
fp2 is 0x100fd2f70
Why - when assigning to a void*
is foo
the same as &foo?