开发者

C - Address of variables in the activation records

开发者 https://www.devze.com 2023-02-07 08:57 出处:网络
What\'s the quickest, easiest way to开发者_开发技巧 find the memory address of the first local variable in the activation record? (In C..)

What's the quickest, easiest way to开发者_开发技巧 find the memory address of the first local variable in the activation record? (In C..)

Doesn't matter what we have declared already. Could be simple as char *s = 'Hello world!'

Thanks!


You can't do that - the C standard doesn't even require that there is a stack, let alone requiring a standard way to find out the order in which variables were put on it.


There is no portable way to do this in C. Any attempt to do this would be platform- and calling convention-specific.

0

精彩评论

暂无评论...
验证码 换一张
取 消