I can't seem to get this access to the correct pointers. I have delared two header nodes as private members in the class to point to the head and tail nodes of a linked list. When I run the constructor (see below), I get access to the header nodes, without any problem. But when I try to run another function on the nodes, especially IsEmpty, I get an access violation when I try to access header1. I have put in if statements in the constructor to check to see if the nodes are getting assigned properly with the memory allocation that is included in another function, and these tests are passed.


//Here is the constructor. Dynamic memory allocation takes place
// in functions "AllocXorStore()". header1->link is
// an unsigned long int that will be typecast to be the address
// of the next node.

xorlist()
{

header1=AllocXorStore();
header2=AllocXorStore();
header1->info=header2->info=NULL;
header1->link=0;
header2->link=0;
printf("\nHeader1->link = %d", (int)header1->link);
//IsEmpty();
Printfunct=NULL;
Compfunct=NULL;
Delfunct=NULL;
if(header1!=NULL)
printf("\n!NULL\n");
};

//checks to see if the list is empty
int IsEmpty()
{
assert(header1);

return(header1->link==0L&&header2->link==0L);
};