Прочитать двойное значение из файла: std::invalid_argument после вызова std::stodC++

Программы на C++. Форум разработчиков
Anonymous
Прочитать двойное значение из файла: std::invalid_argument после вызова std::stod

Сообщение Anonymous »

Код: Выделить всё

#include 
#include 
#include 

int main() {

std::ifstream file("data.txt");
std::string   line, numStr;

// read first line
std::getline(file, line);

// read first value of first line
std::istringstream lineStream(line);
std::getline(lineStream, numStr, '\t');

std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/79172473/read-double-value-from-a-file-stdinvalid-argument-after-stdstod-call[/url]

Вернуться в «C++»