hi im having problems with a doubly linked list. im trying to initialise three names into the list and print them straight off using the list and pointers but cant figure out how. heres what i have already if it could be modified i would greatly appreciate. also please keep the explanations simple as i have only recently started c++
#include <iostream.h>
#include <ctype.h>
#include <string.h>
void initialise(Name *&, char arr[], Name *&);
void DisplayList(Name *) ;
main()
{
Name * Head, * Tail ;
Name *Head = NULL,
*Tail = NULL;
Name *mvlr=NULL;
char s1[]="name1";
char s2[]="name2";
char s3[]="name3";
initialise(s1, Head, Tail);
initialise(s2, Head, Tail);
initialise(s3, Head, Tail);
DisplayList(Head) ;
}
void initialise(Name * &H, Name * &T)
{ H = T = NULL ;
}
void DisplayList(Name * H)
{ ListEntry *curr = H ;
if(H != NULL) {
do {
cout << curr->Name << endl ;
curr = curr->Next ;
}while(curr != H) ;
}
}