According to this movie (around minute 38), if I have two functions with the same local vars, they will use the same space. So the following program, should print 5
5
In the function A, the variable a is not initialized, printing its value leads to undefined behavior.
A
a
In some compiler, the variable a in A and a in B are in the same address, so it may print 5, but again, you can't rely on undefined behavior.
B