读取文件,在图片中显示,异常跳出
char str[32];
sprintf(str, “第%d行”, nLine);
string strFine(str);
string line;
while (getline(read_file, line))
{
int n = line.find(strFine);
if (line.find(strFine) == 0)
{
//查找下一行数据
string line2;
getline(read_file, line2);
while (line2.length() > 0)
{
int i = line2.find(’,’);
if (i > 0)
{
string str = line2.substr(0,i);
m_dLine[iIndex++] = atof(str.c_str());
line2 = line2.substr(i+1);
}
else
{
break;
}
}
break;
}
}