Write your question here.
I am trying to enter string data into a struct Node but the program bombs. I suspect it is line 60 causing the crash. Why so?
If Node::name is a std::string type, you have bypassed the construction mechanism by using the C function malloc so that line 60 invokes a member method of an invalid object.
Prefer to use new/delete in C++ rather than malloc/free
Made the change. Found another bug. Corrected it. Program works. Now to program rest of problem.
Thank you, cire. I am amazed that there is a difference between malloc and new. I just thought they were the same things used for dynamic memory allocation..