Conflict between a Stanford tutorial and GCC

前端 未结 5 1921
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 18:58

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条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 19:17

    It's undefined behavior. An uninitialized local variable has an indeterminate value, and using it will lead to undefined behavior.

提交回复
热议问题