Static vs global

前端 未结 5 507
不知归路
不知归路 2020-11-28 19:57

If I have a C file like below, what is the difference between i and j?

#include 
#include 

static i         


        
5条回答
  •  佛祖请我去吃肉
    2020-11-28 20:29

    The difference is that i has internal linkage, and j has external linkage. This means you can access j from other files that you link with, whereas i is only available in the file where it is declared.

提交回复
热议问题