Here gdb does not stop at Line:4.
Next,
Without hitting the declaration line at Line:5, variable x is existing and initialized.
Next,
But here it shows out of scope (yes it should according to me).
Now, I have the following doubts regarding this particular instance of c program.
- When exactly the memory for variable x in P1() gets created and initialized?
- why gdb did not stop at static declaration statement in inside P1() in the first example?
- If we call P1() again will the program control simply skip the declaration statement?