Why does declaring an extern variable inside main() works,but not defining it inside main() as well?

后端 未结 4 1329
悲哀的现实
悲哀的现实 2021-01-14 04:29

This seems very trivial but a somewhat rigorous explanation for the following behavior will help my understanding of extern a lot.So I\'ll appreciate your answe

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 04:58

    just remember the concept that when we declare a variable as extern inside a function we can only define it outside of that function.

提交回复
热议问题