开发者

C - Address of variables in the activation records

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜