[C++] How to initiate the static data member of a class?
From: Mang (mang-lsc_at_263.net)
Date: 03/21/04
- Next message: Leor Zolman: "Re: Arrays and references"
- Previous message: Irrwahn Grausewitz: "Re: Printing a decimal value stored in a char without converstion to int"
- Next in thread: Gianni Mariani: "Re: [C++] How to initiate the static data member of a class?"
- Reply: Gianni Mariani: "Re: [C++] How to initiate the static data member of a class?"
- Reply: B. v Ingen Schenau: "Re: [C++] How to initiate the static data member of a class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Leor Zolman: "Re: Arrays and references"
- Previous message: Irrwahn Grausewitz: "Re: Printing a decimal value stored in a char without converstion to int"
- Next in thread: Gianni Mariani: "Re: [C++] How to initiate the static data member of a class?"
- Reply: Gianni Mariani: "Re: [C++] How to initiate the static data member of a class?"
- Reply: B. v Ingen Schenau: "Re: [C++] How to initiate the static data member of a class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]