我在程序顶部的声明中包含#include(string),但是当我尝试运行 stoi(string) 或 stoll(string) 时,出现以下错误。我正在运行 Cygwin g++ v4.5.3。
Z:\G\CSCE 437>g++ convert.cpp -o conv convert.cpp: In function
void transfer(std::string*)': convert.cpp:103:36: error:
stoll' is not declared in this scope convert.cpp:116:35: error: `stoi' was not declared in this scope
fileTime[numRec] = stoll(result[0]); //converts string to Long Long
if(numRec = 0){
beginningTime = fileTime[0];
}
fileTime[numRec] = timeDiff;
hostName[numRec] = result[1];
diskNum[numRec] = stoi(result[2]);
type[numRec] = result[3];
offset[numRec] = stoi(result[4]);
fileSize[numRec] = stoi(result[5]);
responseTime[numRec] = stoi(result[6]);`
其中 result 是一个字符串数组。