[C++] How to initiate the static data member of a class?

From: Mang (mang-lsc_at_263.net)
Date: 03/21/04


Date: Mon, 22 Mar 2004 00:23:49 +0800


For Example:
class Test
{
    static int i1; // will i1 be initiated as zero ? when will it ?
    // static int i2 = 1; // why can not do that ?
    static const i3 = 2; // why ok now ?

    // static const int ii[3] = { 1, 11, 111}; // how to initiate
                                                 // an array when
                                                 // declaration?
public:
   Test(); // Can I init a static member here ?
   static void static_init(); // Or init here? will I explicitly
                              // call this function before I
                              // new a instance of Test. Or call
                              // it in the constructor function?
  ~Test();
}

Thanks in advance.