external integer constant
this is working fine but it does pr开发者_Python百科oduce a warning:
extern int const SCREEN_WIDTH;
Need I be concerned about doing this? It functions exactly as intended.
The warning I get is:
SCREEN_WIDTH initialized and declared extern
and
extern variable has an initializer
Sounds like where you set the SCREEN_WIDTH
constant's value, you still have the extern
keyword. Something like:
extern int const SCREEN_WIDTH = 1024;
If so, remove the extern
keyword. It should only be present where you declare the constant, not where you define it. :)
精彩评论