-1
std::ifstream file_stream1(outfile,std::ifstream::out | std::ifstream::binary);
std::vector<double> file;
std::vector<double> file1;
std :: string line;
while (getline (file_stream1, line))
{
double item[100];
std :: string dataEntry; //a particular entry as a string
std :: istringstream lineStream(line);
for(int i = 0; i < 1; i++)
{
//get one entry
getline(lineStream, dataEntry, ',');
lineStream >> std::ws; //remove whitespace after the comma and before the next entry
std:: istringstream(dataEntry) >> item[i];
std :: cout << item[i] << std ::endl ;
file.push_back (item[i]);
file1.push_back (item[i]);
}
- 我想读一个CSV文件C++,我都双倍数据的两列第二列,但问题是它仅打印第一列?
请张贴[MCVE]。 – melpomene