mfc读取多行编辑框的数据

比如一个编辑框里有3行 第一行是100 第二行 200 第三行 300 我要把三个数读取到数组a[0],a[1],a[2]中 怎么写代码?

方法如下:
CEdit类的方法:
int GetLineCount( )
int GetLine( int nIndex, LPTSTR lpszBuffer, int nMaxLength )

这是MSDN的官方示例:
先为Textbox绑定一个CEdit类的变量123456789101112int i, nLineCount = m_myEdit.GetLineCount();CString strText, strLine;// Dump every line of text of the edit control.for (i=0; i < nLineCount; i++){ // length of line i: int len = m_myEdit.LineLength(m_myEdit.LineIndex(i)); m_myEdit.GetLine(i, strText.GetBuffer(len), len); strText.ReleaseBuffer(len); strLine.Format(_T("line %d: '%s'\n"), i, strText); AFXDUMP(strLine);}
温馨提示:答案为网友推荐,仅供参考