D
Divick
Hi I want to know when does the storate allocation happens for member
static data? For example I have following class declared in a header
typedef void (*fptr)(void);
class DllMethods
{
public:
static int data;
static fptr function;
};
int globalData;
//In the implementation I have commented out the static data
initialization
//fptr DllMethods::function = 0;
//int DllMethods::data = 0;
If in the implementation file, I do not do the static member
initialization, then does the compiler allocates storage for the static
data or not? If it allocates space for the static data then what does
the compiler initialize them to? Are they simply left uninitialized?
Thanks,
Divick
static data? For example I have following class declared in a header
typedef void (*fptr)(void);
class DllMethods
{
public:
static int data;
static fptr function;
};
int globalData;
//In the implementation I have commented out the static data
initialization
//fptr DllMethods::function = 0;
//int DllMethods::data = 0;
If in the implementation file, I do not do the static member
initialization, then does the compiler allocates storage for the static
data or not? If it allocates space for the static data then what does
the compiler initialize them to? Are they simply left uninitialized?
Thanks,
Divick