Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. int addNode_str2(char* val,str_node_t **nd){
  2. str_node_t* node = (str_node_t* )malloc(sizeof(mpz_node_t));
  3. if(node==NULL) return -1;
  4. strcpy(node->value,val); //make a copy or it disapear...
  5. if((*nd) == NULL || (*nd)->last == NULL){
  6. (*nd) = node;
  7. (*nd)->last = node;
  8. }else {
  9. (*nd)->last -> next = node;
  10. (*nd)->last = node;
  11. }
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement