This
-
typedef struct _test_
-
{
-
...
-
...
-
} test
-
can be this (note the added ; )
This
-
class test
-
{
-
...
-
private:
-
static test* infoP_m;
-
...
-
};
-
should have a non-conflicting name like this
-
class ctest
-
{
-
...
-
private:
-
static test* infoP_m;
-
...
-
};
-
This
-
//static member initialization
-
test* infoP_m = 0;
-
should be this (otherwise you have just declared a global pointer not a static class member)
-
//static member initialization
-
test *ctest::infoP_m = 0;
-
This
-
//constructor
-
ctest::ctest()
-
{
-
memset(&infoP_m,0,sizeof(infoP_m); // Is this correct
-
...
-
}
-
Is poor style, every time you construct a class of type ctest you set the pointer to NULL, also it can be written more clearly as
-
//constructor
-
ctest::ctest()
-
{
-
infoP_m = 0; // Is this correct
-
...
-
}
-
do I need to instancitate the infoP_m structure (to allocate memory, or it is already allocated ??)
There is no infoP_m structure, it is a pointer and yes you do need to allocate memory to that pointer before you try and use what it points to.