Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. poly *poly_duplicate(poly *P ){
  2.     node *tempNode = P->terms;
  3.     node *duplicateNode;
  4.     node *nextNode = NULL;
  5.     poly *p = malloc(sizeof(poly));
  6.     for (int i=0; i < P->num_terms; i++) {
  7.         tempNode->next = duplicateNode;
  8.         duplicateNode = tempNode;
  9.         p->terms = P->terms;
  10.         p->num_terms = P->num_terms;
  11.         //duplicateNode = tempNode;
  12.         //tempNode = tempNode->next;
  13.     }
  14.     return p;
  15.     //return NULL;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement