I almost don't know C ++. Not an expert.
I am looking at existing code. I could not understand this following code.
typedef enum
{
eEvent_MsgOk,
eEvent_InvalidMsgId,
eEvent_Failure,
} eEventType;
class Rs232Event
{
public:
Rs232Msg* m_pMsg;
eEventType m_eEvent;
}
Rs232Event::Rs232Event(eEventType eEvent,Rs232Msg* pMsg)
: m_pMsg(pMsg), m_eEvent(eEvent)
{
}
Here, using the initialization list, they initialize the values.
But the Rs232Msg class does not have one parameterized constructor.
But he has a constructor that takes 4 parameters.
I could not determine how his call was causing. But the code works without errors.
source
share