struct Edge;
struct Node {
int id;
vector<Edge> *edges;
};
struct Edge {
int id;
Node* vertex1;
Node* vertex2;
};
int main(){
vector<Edge> nodeEdgeList;
Node* nodePtr = new Node;
nodePtr->id = vertex;
nodePtr->edges = nodeEdgeList;
}
由于最后一行,我收到以下编译器错误。
error: cannot convert 'std::vector<Edge, std::allocator<Edge> >' to 'std::vector<Edge, std::allocator<Edge> >*' in assignment