Search code examples
cmemoryvariablesactiverecordactivation-record

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!


Solution

  • 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.