2个Edit数组,如何实现分别相乘呢?
GetDlgItem(IDC_EDIT17)->GetWindowText(edit17);
GetDlgItem(IDC_EDIT18)->GetWindowText(edit18);
if ( edit17.IsEmpty()||edit18.IsEmpty())
{
return;
}
str3.Format("%.2f",atof(edit17));
str4.Format("%.2f",atof(edit18));
m_strArray1.Add(str3);
m_strArray2.Add(str4);
后面怎么写?(edit17,edit18每次输入的数分别相乘,并求和)?
GetDlgItem(IDC_EDIT17)->GetWindowText(edit17);
GetDlgItem(IDC_EDIT18)->GetWindowText(edit18);
if ( edit17.IsEmpty()||edit18.IsEmpty())
{
return;
}
str3.Format("%.2f",atof(edit17));
str4.Format("%.2f",atof(edit18));
m_strArray1.Add(str3);
m_strArray2.Add(str4);
后面怎么写?(edit17,edit18每次输入的数分别相乘,并求和)?
for(
nConut += m_strArray1.getAt(i)*m_strArray2.getAt(i);
}
你的明白?
error C2676: binary '*' : 'class CString' does not define this operator or a conversion to a type acceptable to the predefined operator