| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 847 人关注过本帖
标题:mfc矩阵运算,函数无法获得参数
只看楼主 加入收藏
缥缈孤鸿
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2014-3-3
结帖率:0
收藏
 问题点数:0 回复次数:0 
mfc矩阵运算,函数无法获得参数
void CMyDlg::OnButton1()
{
    CString s1,s2,c,x1,x2;
    int na,nb,i,j;
    CUIntArray m,n,mn;
    GetDlgItemText(IDC_EDIT1,s1);
    GetDlgItemText(IDC_EDIT2,s2);
    for(i=0;i<CEdit::GetLineCount(s1);i++)
    {
        x1=x1+CEdit::GetLine(i,s1)+" ";
    }
    for(j=0;j<CEdit::GetLineCount(s2);j++)
    {
        x2=x2+CEdit::GetLine(j,s2)+" ";
    }
    char *ch1=strtok(x1," ");
    while(ch1!=NULL)
    {
        m.Add(atoi(ch1));
        ch1=(NULL," ");
    }
    char *ch2=strtok(x2," ");
    while(ch2!=NULL)
    {
        n.Add(atoi(ch2));
        ch2=(NULL," ");
    }
    for(i=0;i<m.GetSize();i++)
    {
        mn[i]=m[i]+n[i];
        c=c+itoa(mn[i])+" ";
        if(i%CEdit::GetLineCount(s1)==0) c=c+"\r\n";
    }

    SetDlgItemText(IDC_EDIT3,c);
}




Compiling...
矩阵计算器Dlg.cpp
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(183) : error C2660: 'GetLineCount' : function does not take 1 parameters
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(185) : error C2665: 'GetLine' : none of the 2 overloads can convert parameter 2 from type 'class CString'
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(187) : error C2660: 'GetLineCount' : function does not take 1 parameters
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(189) : error C2665: 'GetLine' : none of the 2 overloads can convert parameter 2 from type 'class CString'
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(191) : error C2664: 'strtok' : cannot convert parameter 1 from 'class CString' to 'char *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(197) : error C2664: 'strtok' : cannot convert parameter 1 from 'class CString' to 'char *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(206) : error C2660: 'itoa' : function does not take 1 parameters
C:\Users\Administrator\Desktop\自学c++\矩阵计算器\矩阵计算器Dlg.cpp(207) : error C2660: 'GetLineCount' : function does not take 1 parameters
执行 cl.exe 时出错.

矩阵计算器.exe - 1 error(s), 0 warning(s)
2014-04-05 23:11
快速回复:mfc矩阵运算,函数无法获得参数
数据加载中...
 
   



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

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