C++ static local function vs global function

后端 未结 4 1598
一整个雨季
一整个雨季 2021-01-31 08:13

What is the utility of having static functions in a file ?

How are they different from having global functions in a file ?

static int Square(int i)
{
            


        
4条回答
  •  广开言路
    2021-01-31 09:06

    Static functions are visible on the file where they were defined only. You can't refer to them outside of that particular file.

    Read more here

提交回复
热议问题