Why does the following print 1
. I was expecting it to print the address of the function pointer.
#include <stdio.h>
int main(main) {
printf("%i",main);
return 0;
}
Pointers must be printed with %p
. Anyway here there's an "aliasing" problem, rather odd but that's it: main gets the value of the first argument to function main that is, what usually is called "argc". if you call it with more arguments, you should see bigger number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With