My code is below, and my problem occurs when I am trying to "loadFile" through my program. It asks me for the filename, and when I give it a filename that it can find, it just says "Segmentation Fault" and stops running. I think the problem is either coming from the loadFile method itself or on line 244 which is where I'm writing the method for adding an element to the linkedlist. Any help is appreciated! Thanks.
Line 224:
void countyElectionList::push_back(countyElectionResults * newCER){
if(head == NULL)
head = newCER;
else
{
countyElectionResults * current = head;
while(current->getNextResult() != NULL){
current = current->getNextResult();
}
current->setNextResult(newCER);
}
}