Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在激活记录中找到第一个局部变量的内存地址的最快、最简单的方法是什么?(在 C..)
不管我们已经声明了什么。可以简单为 char *s = 'Hello world!'
谢谢!
你不能这样做——C 标准甚至不要求有一个堆栈,更不用说需要一种标准的方法来找出变量放在它上面的顺序。
在 C 中没有可移植的方法来做到这一点。任何这样做的尝试都是平台和调用约定特定的。