Uninitialized variable in C

前端 未结 5 1080
滥情空心
滥情空心 2020-12-07 03:15

I\'m a little bit confused. As far as I know, if you declare an int in C, without initializing it, for e.g: int x;

so its value is indeterminate. So if

5条回答
  •  执笔经年
    2020-12-07 04:00

    There is no guarantee that using an uninitialised variable will cause your program to crash - it depends what junk data happens to be in the memory location allocated for the variable.

提交回复
热议问题