ifstream& operator>>(ifst ream & input , Poly & a)
{
char *pol;
pol=new char[];
if(input==cin)
cout<<" Please Enter the Polynomial in a manner +1x^2-1x^1+10x^0 "<<"\n";
input>>pol;///////inputing a polynomial as a string
a.setPoly(pol);
return input;
}
Poly& Poly::setPoly(c har *pol)////////////pointer to a pointer pol of string
{
int size=strlen(*po l);
cout<<*pol;
double *temp1=new double[degree+1],*temp=new double[degree+1],*deg=new double[degree+1];
long i=0,j=0,k=0,cou nt=1,count1=0,c ount2=0,count3= 0,cnt=1,power=0 ,pow=0,p=1,pp=1 ;
for( i=0 ; i<size ; i++)
{
if((int)pol[i]==43)
{
count1=0;
..............c ontinue......
i want to ask that how should i pass a dynamically created string in a setPoly........ ...through pointer to a pointer or simple pointer or array ????
{
char *pol;
pol=new char[];
if(input==cin)
cout<<" Please Enter the Polynomial in a manner +1x^2-1x^1+10x^0 "<<"\n";
input>>pol;///////inputing a polynomial as a string
a.setPoly(pol);
return input;
}
Poly& Poly::setPoly(c har *pol)////////////pointer to a pointer pol of string
{
int size=strlen(*po l);
cout<<*pol;
double *temp1=new double[degree+1],*temp=new double[degree+1],*deg=new double[degree+1];
long i=0,j=0,k=0,cou nt=1,count1=0,c ount2=0,count3= 0,cnt=1,power=0 ,pow=0,p=1,pp=1 ;
for( i=0 ; i<size ; i++)
{
if((int)pol[i]==43)
{
count1=0;
..............c ontinue......
i want to ask that how should i pass a dynamically created string in a setPoly........ ...through pointer to a pointer or simple pointer or array ????
Comment