That's because first
is a pointer of type nodeType
. If you want it to print out the data in the list try:
cout << first->data << endl;
samething if you want to print the last element try
cout << last->data << endl;
good luck.
Last edited on
thanks but what if i wanna print all the data i mean not only the last or the first the assigment was to create a linked list