Однако мне нужно преобразовать эти даты в int, по какой-то причине код нарушается.
Код: Выделить всё
void fileOpener(){
ifstream file;
file.open("WHO-COVID-data.csv");
// stringstream ss;
string date1;
string country1;
string cases1;
string death1;
string month;
string day;
string year;
// string tempCountry;
string line;
// int num1 = 0;
// int num2 = 0;
vector row;
vector info;
while(!file.eof()){
getline(file,date1,',');
getline(file,country1,',');
getline(file,cases1,',');
getline(file,death1,'\n');
stringstream ss = stringstream(date1);
getline(ss,month,'/');
getline(ss,day,'/');
getline(ss,year,'/');
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/74505143/terminate-called-after-stdinvalid-argument-what-stoi-this-is-a-test-code[/url]