When C says start up values of global variables are zero, does it mean also struct members? And what is the initial value of a pointer?

后端 未结 2 1534
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-26 16:50

When C says start-up values of global[/static] variables are zero, does it mean also struct members? And what is the initial value of a [global/static] pointer? NULL?

2条回答
  •  孤街浪徒
    2021-01-26 17:02

    Yes, all static variables, of whatever type, will be set to zero. That includes pointers - a NULL pointer is a pointer that is set to zero.

提交回复
热议问题