M
Matt Graham
Here's a subset of a class I'm trying to initialize:
class uiForm {
public:
uiForm();
uiForm( unsigned short );
unsigned short m_method;
unsigned short m_form_id;
FormType *m_frmP;
char *m_title;
};
I have this as my null constructor and the constructor below is passed
an integer to set one of the parameters. But I want the rest of the
data to be initialized the same as in the empty constructor. Now,
what I'm wondering is if there is a way I can have integer constructor
call the null constructor, and then I can initialize the one m_form_id
value explicitly.
uiForm::uiForm() :
m_method( 1 ),
m_form_id(),
m_frmP(),
m_title()
{
}
uiForm::uiForm( unsigned short frm_id ) : m_form_id( frm_id )
{
}
Thanks,
Matt
class uiForm {
public:
uiForm();
uiForm( unsigned short );
unsigned short m_method;
unsigned short m_form_id;
FormType *m_frmP;
char *m_title;
};
I have this as my null constructor and the constructor below is passed
an integer to set one of the parameters. But I want the rest of the
data to be initialized the same as in the empty constructor. Now,
what I'm wondering is if there is a way I can have integer constructor
call the null constructor, and then I can initialize the one m_form_id
value explicitly.
uiForm::uiForm() :
m_method( 1 ),
m_form_id(),
m_frmP(),
m_title()
{
}
uiForm::uiForm( unsigned short frm_id ) : m_form_id( frm_id )
{
}
Thanks,
Matt