I was actually asked this problem on a job interview (not Google) and gave the answer your boss pointed out, but the interviewer then pointed out that local variables aren't necessarily laid out in memory in the order they're declared.
The function call is the only reliable way I can think of. Any others?
The function call is the only reliable way I can think of. Any others?