January 25, 2008

How to initialize static member variable?

class X
{
public:
    static int i;
};
int X::i = 0; // definition outside class declaration