On a stack-based machine,
value that an uninitialized local variable happens to receive
tends to depend on what is on the stack
and hence what has been called recently.
That's why inserting or removing debugging printouts can
make a bug go away:
printf is a big function,
so calling it or not can make a big difference
what's left on the stack.
about this FAQ list