I'm trying to read lines of a text file, and its crashing during the third iteration. There are 3 lines in the text file.
The debugger says that there is a segmentation fault, which I assume means that I'm trying to access something out-of-range. The problem is, result is an std::map...so it shouldn't have a set range.
Code:
while(!file.eof())
{
std::getline(file, line);
result[id] = new Task(line); // Crashing here on the third iteration
id++;
}
The debugger says that there is a segmentation fault, which I assume means that I'm trying to access something out-of-range. The problem is, result is an std::map...so it shouldn't have a set range.