Could you tell me something about 'static'?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// A program based single document
// CMainFrame.CPP

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()

static UINT indicators[] =
{
        ID_SEPARATOR,          // status line indicator
        ID_INDICATOR_CAPS,
        ID_INDICATOR_NUM,
        ID_INDICATOR_SCRL,
};

If I mask keyword 'static', there is no impact.
What is rationale about the keyword of 'static' be added here?
IIRC, static when applied to globals limits their scope only to the .cpp they're defined in, so if a different file tried to use indicators, it would fail.
I see, Thanks!
Topic archived. No new replies allowed.