HI!
i need help with this simple code!!!
i don't know what's wrong but i guess it's in the ReadPoly
it's for reading two poly and summing and multiplying them
this is the code :
#include <iostream>
using namespace std;
struct spoly
{
int val;
int power;
spoly *next;
};
spoly poly;
void insertion (spoly *&LS,spoly ele)
{
spoly *temp,*NI,*PI;
temp = new spoly;
temp->power =ele.power;
temp->val =ele.val;
temp->next=NULL;
if (LS ==NULL)
LS=temp;
else
{
NI=LS;
bool Located =false;
while (NI!=NULL && !Located)
{
if (NI->power > ele.power)
{
PI=NI;
NI=NI->next;
}
else
Located=true;
}
temp1=temp1->next;
}
}
void main ()
{
cout<<"******************Welcome To The Program*****************"<<endl;
spoly *ls1=NULL;
ls1= new spoly;
spoly *ls2=NULL;
ls2= new spoly;
spoly *ls3=NULL;
ls3= new spoly;
cout<<"Enter First Poly"<<endl;
ReadPoly(ls1);
cout<<"POLY1=";
WritePoly(ls1);