下面一段程序,是一个小计算程器程序中按钮1的一个段功能代码,帮我理解一下行么。不明白
void CCalculatorDlg::OnButton1()
{
//TODO: Add your control notification handler code here
UpdateData(TRUE);
if (m_Operator == ' ')
{
m_Result = m_Result * 10 + 1;
m_Num = m_Result;
}
else
{
if (m_bCalc == FALSE)
{
m_Result = 0;
}
m_bCalc = TRUE;
m_Result = m_Result * 10 + 1;
}
UpdateData(FALSE);
}
void CCalculatorDlg::OnButton1()
{
//TODO: Add your control notification handler code here
UpdateData(TRUE);
if (m_Operator == ' ')
{
m_Result = m_Result * 10 + 1;
m_Num = m_Result;
}
else
{
if (m_bCalc == FALSE)
{
m_Result = 0;
}
m_bCalc = TRUE;
m_Result = m_Result * 10 + 1;
}
UpdateData(FALSE);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货