标题:mfc结果在编辑框中输出错误
取消只看楼主
缥缈孤鸿
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2014-3-3
结帖率:0
 问题点数:0 回复次数:0 
mfc结果在编辑框中输出错误
void CMy89Dlg::OnButton1()
{

     int A[3][3],B[3][3],C[3][3],a[10],b[10],c[9],i=0,j=0,s;
  char c1[10],c2[10],c3[10];
  GetDlgItemText(IDC_EDIT1,c1,10);
  GetDlgItemText(IDC_EDIT2,c2,10);
  char *cc1=strtok(c1," ");
  while(cc1!=NULL)
  {
      a[i]=atoi(cc1);
      i++;
      cc1=strtok(NULL," ");
  }
  char *cc2=strtok(c2," ");
  while(cc2!=NULL)
  {
      b[j]=atoi(cc2);
      j++;
      cc2=strtok(NULL," ");
  }
  for(i=0;i<9;i++)
      {
          A[i/3][i%3]=a[i];
          B[i/3][i%3]=b[i];
  }
  int n=0;
  for(i=0;i<3;i++)
  {
      for(j=0;j<3;j++)
      {
          C[i][j]=0;
          for(s=0;s<3;s++)
          {
          C[i][j]=C[i][j]+A[i][s]*B[s][j];
          }
          c[n]=C[i][j];
          n++;
      }
  }
  for(i=0;i<9;i++)
  {
      SetDlgItemInt(IDC_EDIT3,c);
      cout<<" ";
      if(i%3==0) cout<<"\n";
  }   
}
提示“error C2664: 'SetDlgItemInt' : cannot convert parameter 2 from 'int [9]' to 'unsigned int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
2014-04-02 16:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-429574-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.103327 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved