Simple code, eg:
简单的代码,例如:
void* print_my_address() {
printf("%p\n", .../* get the execution address of print_my_address */)
}
Thanks!
PS: gcc v4.7 Can I get the address by compiler?
PS:gcc v4.7我可以通过编译器获取地址吗?
1 个解决方案
#1
4
The same way you'd do it for any other regular variable:
对于任何其他常规变量,您也可以这样做:
void print_my_address()
{
printf("%p\n", &print_my_address);
}
#1
4
The same way you'd do it for any other regular variable:
对于任何其他常规变量,您也可以这样做:
void print_my_address()
{
printf("%p\n", &print_my_address);
}