This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Template linking problem


On Nov 7, 2007, at 10:26 AM, Harvey Chapman wrote:

class A
{
public:
 static int number;
};

int A::number;

The line above is required.


That'll teach me to compile and test before e-mailing. I guess I've just never used a static data member in a class before, I usually only use static variables inside functions, if ever.

So, back to the original question, why do I have to specfically re- declare the static data member outside of the class header?

Thanks,

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]