Thanks, this fixed the problem.
I get a run time error for the label now. When I create an array of Nodes and allocate memory for them, it says <Bad Ptr> in the value for the label (when debugging). What can this possibly be?
Node *words_array;
words_array=(Node *) malloc(no_lines*sizeof(Node));
.
.
.
(*words_array).SetNodeLabel(node_string); //this is where the run time error occurs because of the bad pointer for the label, i.e. the string cant be assigned to the label in the node
This code is like Pandora's box! Yes you are right, I used C approach. But after fixing it, I got an unresolved externals compilation error. What am I doing so wrong?
error LNK2019: unresolved external symbol "public: __thiscall Node::~Node(void)" (??1Node@@QAE@XZ) referenced in function "void __cdecl ReadNouns(char * const,struct _iobuf *)" (?ReadNouns@@YAXQADPAU_iobuf@@@Z) SemanticSearch_Functions.obj SemanticSearch
99% of the time "unresolved external symbol" means you defined a function prototype, but never gave that function a body.
In this case, the function is your destructor, ~Node().
Give that a body.
EDIT:
It's somewhat strange that you had this linker error after you got a runtime error. How could the program have been running before if you had this problem?
I added body to the destructor, and voila! Its working! You are a genius! Thanksss so much! My lack of experience in c++ was gonna make me suffer for days :)