External integer constant

this works fine, but it raises a warning:

extern int const SCREEN_WIDTH;

Do I need to worry about this? It functions exactly as intended.

I get a warning:

SCREEN_WIDTH initialized and declared extern

and

extern variable has an initializer

+4
source share
1 answer

It sounds as if you set the SCREEN_WIDTH constant, you still have the extern keyword. Sort of:

extern int const SCREEN_WIDTH = 1024;

If so, remove the extern keyword. It should be present only where you declare a constant, and not where you define it. :)

+16
source