Here is the english version:
http://rapidshare.com/files/324297385/cprog-eng.c.html
If you want to understand logic, you have to know Horner's scheme:
http://en.wikipedia.org/wiki/Horner_scheme
It is pretty simple but effective algorithm for evaluation of polynomials.
Note: There are some more functions in code, than it's really needed. I have added those in process of debugging to check out certain segments of code.
Can you please send me exe file of my code? I want to check out that.
I suspect now the source of the problem is maybe 32-bit compiler on 64-bit machine.
|
Go4Expert Member
|
|
| 22Dec2009,15:00 | #11 |
|
Skilled contributor
|
![]() |
| 22Dec2009,16:14 | #12 |
|
yah i think that thatz the only problem. Try to run ur code in 32bit system. here is the link for ur exe:-
http://rapidshare.com/files/324322882/CPROG.EXE.html |
|
Go4Expert Member
|
|
| 22Dec2009,17:45 | #13 |
|
Thanks, mate! I'll try that on my friend's 32bit pc and see what happens.
|
|
Go4Expert Member
|
|
| 23Dec2009,20:48 | #14 |
|
I made it
![]() The problem was with one pointer referring to NULL value. Here is the corrected version: Code:
struct pnode *bform(struct pnode *coeff, int a)
{
struct pnode *p=coeff;
struct pnode *temp1=p;
struct pnode *proba=NULL;
double b=temp1->coeff;
proba=insert(proba,1,b);
while(temp1->link!=NULL)
{
temp1->link->coeff=a*(temp1->coeff)+(temp1->link->coeff);
proba=insert(proba,1,temp1->link->coeff);
temp1=temp1->link;
}
return(proba);
}
It's not a big deal, but I couldn't find anyone did this using linked lists. It's way easier with arrays. |


