* Eric:
Shouldn't I be able to do this?
In file1.cpp:
extern const int aConst = 8;
= = = = = = = =
In file2.cpp
extern const int aConst;
class aClass
{
public:
char* foo[ aConst ];
};
= = = = = = = =
The compiler barfs on char* foo[ aConst } telling me that aConst isn't
a constant.
I know the above doesn't work in C but I'm pretty sure it's supposed
to work in C++.
The short of it is that you're using a link-time constant, wheras what's
required is a compile-time constant.
Of course the standard does not even acknowledge the existence of
compilers and linkers, except to the degree linking is suggested by
words such as "linkage".
But I think it's easier explain from the point of view of reality... ;-)
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?