Internal static variables in C, would you use them?

后端 未结 13 1545
甜味超标
甜味超标 2020-12-07 19:09

In C you can have external static variables that are viewable every where in the file, while internal static variables are only visible in the function but is persistent

13条回答
  •  孤街浪徒
    2020-12-07 19:40

    They are used to implement tools like strtok, and they cause problems with reentrancy...

    Think carefully before fooling around with this tool, but there are times when they are appropriate.

提交回复
热议问题