Can someone explain when you're supposed to use the static keyword before global variables or constants defined in header files?
For example, lets say I have a header file with the line:
const float kGameSpriteWidth = 12.0f;
Should this have static
in front of const
or not? What are some best practices for using static
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…