Insert a Node at the Tail of a Linked List

  • + 1 comment

    my program is the same as yours except the first part of the code where mine says

    Node *temp;    //did not use Node*temp=new Node
    temp->data=data;
    temp->next=NULL;
    

    This is causing error in my code.. Can you please explain?