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每次输入的数分别相乘,并求和)? 
 
 

解决方案 »

  1.   

    你把两个edit控件的值得到以后,转换为int或其它类型,相乘在显示出来不就可以吗
      

  2.   

    后面怎么写?(edit17,edit18每次输入的数分别相乘,并求和)?  看不懂楼主什么意思,数据得到了相乘、求和还会难吗?
      

  3.   

    m_strArray1数组有3个数(2,3,4),m_strArray2数组有3个数(5,6,7),想要求2*5+3*6+4*7应该如何写程序?
      

  4.   

    int nConut = 0;
    for(
     nConut += m_strArray1.getAt(i)*m_strArray2.getAt(i);

    你的明白?
      

  5.   

    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