co - c++ - trying to insert node into vector <node> but program keep crashing at push_back -
So I put a link of the stars in the linked list. I try to input these nodes in the vector. But whenever I try push_back, the program only crashed. Here's my code. I have two squares, nodes and piles
piles; Of vector & lt; Node & gt; * Vstring;
After trying Dennis's solution, I was able to fix the problem. Although I have another problem, the material is actually vector for
(int i = 0; i
I get the following error: Error: 'operator & lt; & Lt; & gt; There are no matches for (opernd type 'std :: ostream {aka std :: basic_ostream}' and 'std :: vector') cout & lt; & Lt; * H & LT; & Lt; Endl; ^ In the node class, I have & lt; & Lt; Operator overloaded
Ostream & amp; Operator & lt; & Lt; (Ostream & out, const node & amp; n) {cout & lt; & Lt; "In operator" & lt; & Lt; Endl; From the outset & lt; & Lt; N.data; Return; }
vector & lt; Node & gt; * Vstring;
Not Started
Vector & lt; Node & gt; * Vstring = new vector & lt; Node & gt; ();
Comments
Post a Comment