Code:struct node{ string location; int gval; int fval; node *next; };For some reason the cout produces output fine with the string value of graph[index].location but when I debug my program, it crashes right atCode:struct node *hp; for(int i = 0; i<graph.size();i++) { cout << graph[i].location <<"=="<<graph[0].location<<"?\n"; if((graph[i].location).compare(start)==0) { index = i; break; } } cout<<"Found "<< graph[index].location; //make starting nodes hp = (struct node*)(malloc(sizeof(struct node))); hp->location = graph[index].location;Also graph is defined asCode:hp->location = graph[index].location;
Code:vector<vertice> graph = initializeGraph();Graph is a vector of vertice. Also when I am in the debugger, and I try to track the value of graph[i].location in the for loop, I getCode:struct Edge { string destination; int weight; }; struct vertice { string location; vector<Edge> directions; };Code:graph[i].location CXX0058: Error: overloaded operator not found



1Likes
LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.