Zyrenthian
Programmer
I am just curious why when I :
typedef struct _SMemberVariableLookupTable{
char* path;
void* ptr;
int size;
}SMemberVariableLookupTable;
i can declare:
int x = 7;
SMemberVariableLookupTable[] = {
{ "Hello",
&x,
sizeof(x)
},
{
"goodbye",
&x,
sizeof(x)
}
};
BUT if i put a constructor in
typedef struct _SMemberVariableLookupTable{
char* path;
void* ptr;
int size;
_SMemberVariableLookupTable()
{memset(this,0,sizeof(this));}
// or this constructor
_SMemberVariableLookupTable()tr(0),size(0){}
}SMemberVariableLookupTable;
It will no longer compile. If anyone could offer some insight it would be great.
Thanx
Matt
typedef struct _SMemberVariableLookupTable{
char* path;
void* ptr;
int size;
}SMemberVariableLookupTable;
i can declare:
int x = 7;
SMemberVariableLookupTable[] = {
{ "Hello",
&x,
sizeof(x)
},
{
"goodbye",
&x,
sizeof(x)
}
};
BUT if i put a constructor in
typedef struct _SMemberVariableLookupTable{
char* path;
void* ptr;
int size;
_SMemberVariableLookupTable()
{memset(this,0,sizeof(this));}
// or this constructor
_SMemberVariableLookupTable()tr(0),size(0){}
}SMemberVariableLookupTable;
It will no longer compile. If anyone could offer some insight it would be great.
Thanx
Matt