Crash after certain point

Hi so this is my first post, Im trying to type a function that will display a linked list. I dont have any errors but when I compile it and try to display the linked list my program crashes.

void displayList ( AccountNode* list ) {
AccountNode* current = list;
do {
cout<<"display"<<endl;
Account* tx = current->account;
displayAccount (*tx );
cout<<"display1"<<endl;
current = current->next;
} while ( current != NULL );
}

void displayDate ( Date date ) {

cout << date.month << "/" << date.day << "/" << date.year << " ";
cout << date.hour << ":" << date.minutes << ":" << date.seconds;

}

void displayAccount ( Account tx ) {
displayDate ( tx.date );
cout << tx.firstName << "," << tx.lastName << "," << tx.number<<","<<tx.type<<","<<tx.openningBalance << endl;
}

Thats my displayList and all other functions in it. Right after displayAccount(*tx) the program crashes so Im assuming something is wrong with the displayAccount function but I cant see what.
PLEASE HELP!!!
I expect you're trying to use a pointer that's not pointing to an account. If you run your code under a debugger you can check.
Last edited on
Topic archived. No new replies allowed.