0

What's wrong with my code

poly*trier(poly*p) {poly* temp1 poly* temp2; int a,b; temp1=(poly*)malloc(sizeof(poly)); temp2=(poly*)malloc(sizeof(poly)); if(p==NULL) {return NULL; } for(temp1=p;temp!=NULL;temp1=temp1->link) {for(temp2=temp1->link;temp2!=NULL;temp2=temp2->link) { if(temp1->deg<temp2->deg) { a=temp1->coef; b=temp1->deg; temp1->coef=temp2->coef ; temp1->deg =temp2->deg; temp2->coef=a; temp2->deg=b; } } } return p; } main () {poly*p=creerpolynome(); afficherpoly(p); poly*p=trier(p); return 0; }

12th Dec 2019, 7:24 AM
Fatizo
Fatizo - avatar
1 Answer
0
There are inconsistencies and missing pieces in your code, it will be difficult to check a code under such condition. Just a tip, save it in your SoloLearn profile and share the link instead. Codes with more than 15 lines instructions are better off shared as link, easier to check, posting code as raw text means people have to copy and paste it before they can even check it. Follow this guide to sharing links 👍 https://www.sololearn.com/post/74857/?ref=app
12th Dec 2019, 9:58 AM
Ipang