我正在尝试从看起来像这样的文本文件中读取列
名称 number1*number2
为什么是这样
Float_t value=0;
ifstream ifs("values.dat");
string line;
while(std::getline(ifs, line)) // read one line from ifs
{
istringstream iss(line); // access line as a stream
string dataname;
ifs >> dataname >> value; // no need to read further
但它无法读取“*number2”部分,即它仅将 number1
值传递给 xs
。我该如何解决这个问题?
最佳答案
关于c++ - 用 ifstream 读取 "*",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30920150/