Ive got a struct called Node that contains, among other things, a pointer to a vector of pgm objects. (pgm is a class i've created)
vector <pgm> *ptr;
in another class, i create a vector and a Node and am having trouble assigning the pointer in the Node to point to my new vector.
vector <pgm> lessData;
This all compiles ok, but the last line in the code above causes a segmentation fault. Any clues as to what i'm doing wrong here?
I should mention Node is declared on its own in Node.h and has no idea what pgm is. including pgm.h in node.h makes no change to the problem.
Last edited on
You haven't created a new node yet.
Node *left = new Node;
Thanks mate, I need to do more coding, I should have picked that up.