数字转成字符串,并接连到一起!
程序代码:
CString s_str[5]; CString s_strs; UpdateData(1); m_totalScore=m_unitScore+m_teacherScore+m_respondentScore; m_averageScore=(m_unitScore+m_teacherScore+m_respondentScore)/3; // s_str=CString(m_idNum)+m_Name+m_workUnit+CString(m_unitScore)+CString(m_teacherScore)+CString(m_respondentScore)+CString(m_averageScore)+CString(m_totalScore); s_str[0].Format("%d",m_idNum); 这里是转换 s_str[1].Format("%d",m_unitScore); s_str[2].Format("%d",m_teacherScore); s_str[3].Format("%d",m_respondentScore); s_str[4].Format("%d",m_averageScore); s_str[5].Format("%d",m_totalScore); s_strs=CString("编号")+CString("姓名")+CString("实习单位")+CString("单位评分")+CString("老师评分")+CString("答辩成绩")+CString("平均成绩")+CString("总成绩\n")+s_str[0]+m_Name+m_workUnit+s_str[1]+s_str[2]+s_str[3]+s_str[4]+s_str[5]; 将他们连接起来 // +m_Name+m_workUnit+m_unitScore+m_teacherScore+m_respondentScore+m_averageScore+m_totalScore; m_studentShow = s_strs; UpdateData(0);编译的时候没问题,生成EXE也没问题,就是执行这个的时候就提示错误!内存问题