i am trying to insert a 2 integer values into the linked list, but the program keeps crashing after it gets to inserting into a linked list.
struct termNode
{
int coeff;
int exp;
termNode * link;
};
void insertHead(int c, int e, termNode * & P)
{
termNode * temp;
temp -> coeff = c;
temp -> exp = e;
temp -> link = NULL;
P -> link = temp;
P = P -> link;
}
i know the problem is with the inserting as i have done error checking and crashes at this point.