[Solved] display function not displaying data [closed]


I think you started in the wrong way: your node structure contains pointer to a pointer.

struct node
{
    string info;
    struct node **next;
};

that might be the reason the code does not make sense. You can use (and generally you do things this way) a simple pointer:

struct node
{
    string info;
    struct node *next;
};

This way everything look more manageable:

node a;
a.info = "abc"; //this is your info
a.next = NULL //

this is the connection to the next node in the tree

Using pointer to pointer to determine the next element in your data structure is pointless(as far as I can tell from your example), and you have to be careful about memory allocation.

Hope this helps

solved display function not displaying data [closed]