What does it mean when the function in global namespace is declared as static C++? [duplicate]

限于喜欢 提交于 2020-01-04 06:34:27

问题


Possible Duplicate:
What is a “static” function?

I have seen a function in a global namespace that is declared like this:

static int function_name(int a, double* p, int c, float * u)
{
     //do something with these arguments
}

What the static keyword means here?

EDIT: Now when I know what is for static, please explain what advantage gives the restriction of a function to be visible in a file only where it is declared? I mean why I should restrict my function visibility, what it gives to me?

来源:https://stackoverflow.com/questions/5300627/what-does-it-mean-when-the-function-in-global-namespace-is-declared-as-static-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!