Help with node?

Function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int Scores::Display()
{
        //temp node to traverse
        node * current = head;

        if(head != NULL)
        {
                while(current -> next != NULL)
                {
                        cout << "Last name : " << current -> lastname << ".\n"
                             << "First name : " << current -> firstname << ".\n";
                        current = current -> next;
                }
                cout << "Last name : " << current -> lastname << ".\n"
                     << "First name : " << current -> firstname << ".\n";
        }
        else
        {
                cout << "The list is empty!";
        }


}


Please enter the student's first and last name.
First name : Bob
Last name : Marley
How many program assignments did this student finish?
3
Would you like to add another student?
n
▒ԂLast name : n
First name : ▒ӂ
Assignments completed : 3/5.


I'm not sure why it outputs it differently from my Display function. If I cout from my Insert function it shows the information inside the node just fine, but when I call Display in main it shows those symbols and stuff. Any ideas?
Seems like some sort of memory corruption. Are you sure your "end" pointers are pointing to NULL?
Please show your entire code.
Topic archived. No new replies allowed.