MFC输出数组到编辑框显示

来源:互联网 发布:淘宝网舞蹈演出服装 编辑:程序博客网 时间:2024/05/12 04:19
<span style="color: rgb(85, 85, 85); font-family: 'microsoft yahei'; font-size: 15px; line-height: 35px;">自己也是刚入门,比较简单的一个问题,但也让我纠结了好长时间,现在把我自己程序当中用到的写在这里,希望能帮到大家</span>
<pre name="code" class="cpp">double pt[4];//自己赋值,我是程序当中保存了四个数据到这个数组  CString str,o_str;  int i;  for(i=0;i<4;i++)      {         str.Format("%8.2f",pt[i]);      o_str+=str;      o_str+="\r\n";      SetDlgItemText(IDC_EDIT1,o_str);       } 
<span style="color: rgb(85, 85, 85); font-family: 'microsoft yahei'; font-size: 15px; line-height: 35px;">程序比较简单,下面是通过给编辑框添加变量来实现</span>
str.Format("%f",area);  m_edit+=str; //加入接收编辑框对应字符串  m_edit+="\r\n";  GetDlgItem(IDC_EDIT1)->SetWindowText(m_edit);  
这段代码是输出变量,不是输出数组的

                                             
1 0
原创粉丝点击