1234567
for(int i = 0; i < gSize; i++){ cout << "Starting vertex :" << i+1; list<weights>::iterator it; for( it = graph[index].begin(); it != graph[index].end(); it++){ cout << " to vertex:" << it -> adjVertex << " weight: " << it -> edgeWeight; } }
12
weightedGraph.cpp:93: error: invalid types `std::list<weights, std::allocator<weights> >*[char*()(const char*, int)]' for array subscript weightedGraph.cpp:93: error: invalid types `std::list<weights, std::allocator<weights> >*[char*()(const char*, int)]' for array subscript
1234
struct weights { int adjVertex; int edgeWeight; };
list<weights> *graph;
graph[index]