W
William Payne
Hello, in my application (which spans approximately 20 source files and a
2-3 thousand lines) I have a few global varialbes, variables that never
change their values. One of them is declared like this:
/* globals.h */
extern const int g_tray_icon_callback;
/* globals.cpp */
const int g_tray_icon_callback = 4711;
Now, when I tried to use that variable as a case label in switch statement,
I got:
main_dialog_procedure.cpp:64: error: case label does not reduce to an
integer
constant
So, I replaced the const int with a #define and it compiles, but why can't I
use a const int? I thought const would be const, but I guess not...
// William Payne
2-3 thousand lines) I have a few global varialbes, variables that never
change their values. One of them is declared like this:
/* globals.h */
extern const int g_tray_icon_callback;
/* globals.cpp */
const int g_tray_icon_callback = 4711;
Now, when I tried to use that variable as a case label in switch statement,
I got:
main_dialog_procedure.cpp:64: error: case label does not reduce to an
integer
constant
So, I replaced the const int with a #define and it compiles, but why can't I
use a const int? I thought const would be const, but I guess not...
// William Payne