ok so i have this
Code:
class Poly{
private:
struct node { int exponent;
double coefficient;
struct node *next;
};
typedef struct node ListNode;
ListNode *first;
public:
Poly(){ first = NULL;}
etc....
};
Poly* Poly::addPoly(Poly *p2)
{
if(product!=NULL && temp!=NULL)
stuff
}
Poly* Poly::multiplyPoly(Poly *p2)
{
Poly *temp = new Poly();
Poly *product = new Poly();
product->addPoly(temp); (assuming product and temp have values
but when i pass it, it sets product->first=NULL
which in the function addPoly, it ignores the if loop
which i need it to go through. is there a way to make
product->first!=NULL the two
objects are passed?)