What is the difference between static global and non-static global identifier in C++?

前端 未结 4 1517
走了就别回头了
走了就别回头了 2021-01-31 03:46

What is the difference between static global and non-static global identifier in C++?

4条回答
  •  情歌与酒
    2021-01-31 04:16

    Static limits the scope of the variable to the same translation unit.
    A static global variable has internal linkage.
    A non-static global variable has external linkage.

    Good Read:
    What is external linkage and internal linkage?

提交回复
热议问题