C
C. J. Clegg
When you say "const int FOO = 0" (as the commonly-recommended C++
alternative to "#define FOO 0"), isn't that declaration globally
visible?
I have "const int FOO = 0;" in one source file and "extern int FOO;"
in another source file (also tried "extern const int FOO;") and at
link time, I get undefined references to FOO.
Removed the "const" from the FOO declaration and everything worked
fine.
Does "const" make it static (file scope)? Certainly seems to...
alternative to "#define FOO 0"), isn't that declaration globally
visible?
I have "const int FOO = 0;" in one source file and "extern int FOO;"
in another source file (also tried "extern const int FOO;") and at
link time, I get undefined references to FOO.
Removed the "const" from the FOO declaration and everything worked
fine.
Does "const" make it static (file scope)? Certainly seems to...