ifstream fin(filename.c_str());//以输入方式打开文件存到缓冲空间fin中
string line;
int i=0;
int comma=0;
while(getline(fin,line))//读取fin中的整行字符存在line中
{
int comma=line.find(',',0);
float A[i]=atof(line.substr(comma+1,line.length()-comma-1).c_str());
//将line中的相应位置的字符串转换成float类型放在数组中
i++;
}