Sep 26, 2015 at 4:36pm UTC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
void LinkedList::printList()
{
cout << "\nEntered printList..." << endl;
int count = 0;
node * p = head;
node * q = head;
cout << "\n---------------------\n" ;
cout << " Car List\n" ;
while (q)
{
p = q;
cout << "---------------------\n" ;
cout << "\t position: " << count << "\n" ;
cout << "\t name: " << p -> name << "\n" ;
cout << "\t ICnumber: " << p -> ICnumber << "\n" ;
cout << "\t Plate Number: " << p -> plate << "\n" ;
cout << "\t Model: " << p -> model << "\n" ;
cout << "\t Engine Capacity: " << p -> capacity << "\n" ;
cout << "\t Color: " << p -> color << "\n" ;
cout << "\t Year Manufactured: " << p -> yearmanufactured<<"\n" ;
q = p -> next;
count++;
}
}
Last edited on Sep 26, 2015 at 4:46pm UTC