Trying to understand what the pointer to function actually represent? Is it the address in the code segment where the function resides?
For ex: this piece of code:
#include <stdio.h>
void foo(void)
{
}
int main(void)
{
int a = 10;
printf("a's address: %p\n", &a);
printf("foo's address: %p\n", foo);
return 0;
}
... prints this:
[sh/prog-exercises/adam]:./a.out
a's address: 0xbfffb414
foo's address: 0x8048430
I guess I am a little confused with how exactly stack/heap of a process relates with the ELF data-segment/code-segment. Any helpful pointers would be really welcome. Also, my first question, so please be gentle, am really trying to learn. Thanks!