How do I share a global variable between c files?

前端 未结 7 1100
一生所求
一生所求 2020-12-07 18:28

If i define a global variable in a .c file, how can i use the value of the same variable in another .c file?

file1.c

#incl         


        
相关标签:
7条回答
  • 2020-12-07 19:34

    In the second .c file use extern keyword with the same variable name.

    0 讨论(0)
提交回复
热议问题