Can I mix extern and const, as extern const? If yes, does the const qualifier impose it's reign only within the scope it's declared in or should it exactly match the declaration of the translational unit it's declared in? I.e. can I declare say extern const int i;
even when the actual i is not a const and vice versa?
The usual pattern is:
extern const int a_global_var;
#include "file.h"
const int a_global_var = /* some const expression */;
Edit: Incorporated legends2k's comment. Thanks.