A
Aing
Anyone knows what can be cause of this problem?
////////////////////////////////////////////////////////////
typedef struct _date_struct {
int date,month,year;
}date_struct;
Class Date {
private :
date_struct m_data;
public :
Date& operator=(const Date& );
//.. Other stuff
};
Date::~Date()
{
FreeStruct(&m_data);
}
Date& Date:perator = (const Date& SrcDate)
{
FreeStruct(&m_Data);
///...
return * this;
}
void Date::FreeStruct(Date& lpData) //<- here is the problem.
{
memset(lpData,0,sizeof(Date));
return;
}
/////////////////////////////////////////////////////
My application crashed because lpData was set to 0x0000014 or some
address around here. (I saw from DrWatSon log) But it doesn't happen
every I run the program. Anyone can tell me where this value from ? Is
there something wrong in my code?
////////////////////////////////////////////////////////////
typedef struct _date_struct {
int date,month,year;
}date_struct;
Class Date {
private :
date_struct m_data;
public :
Date& operator=(const Date& );
//.. Other stuff
};
Date::~Date()
{
FreeStruct(&m_data);
}
Date& Date:perator = (const Date& SrcDate)
{
FreeStruct(&m_Data);
///...
return * this;
}
void Date::FreeStruct(Date& lpData) //<- here is the problem.
{
memset(lpData,0,sizeof(Date));
return;
}
/////////////////////////////////////////////////////
My application crashed because lpData was set to 0x0000014 or some
address around here. (I saw from DrWatSon log) But it doesn't happen
every I run the program. Anyone can tell me where this value from ? Is
there something wrong in my code?