Printf the current address in C program

后端 未结 8 1327
时光说笑
时光说笑 2021-02-04 12:27

Imagine I have the following simple C program:

int main() {

int a=5, b= 6, c;
c = a +b; 
return 0;
}

Now, I would like to know the address of

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 12:42

    I don't know the details, but there should be a way to make a call to a function that can then crawl the return stack for the address of the caller, and then copy and print that out.

提交回复
热议问题