Re: Template linking problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux