I am trying to use stod()
but I am getting the error: 'stod' was not declared in this scope.
I HAVE enabled c++ 11 and c++ 0x standards and neither have worked. As far as I can see, that is the only solution any of the other questions like his have come to.
using CodeBlocks 16.01
#include <iostream>
#include <fstream>
#include <array>
#include <string>
using namespace std;
int main()
{
double questions[5][5];
string inLine;
string buffer[5][5];
int found;
ifstream inGrade ("Grades.txt");
if (inGrade) {
while (!inGrade.eof()){
getline(inGrade, inLine);
while (inLine != "\0") {
found = inLine.find(" ");
for (int i = 0; i < 6; i++) {
for (int j= 0; j < found; j++) {
buffer[i][j] += inLine[j];
questions[i][j] = stod(buffer[i][j]);
}
}
inLine.erase(0, found + 1);
}
}
}
return 0;
}