c - Stackdump Error working with Linked Lists -


i working on homework assignment linked lists. 1 of functions need write add node of linked list. code wrote in attempt follows:

void add_back(struct node **list, int value) {   /* variable declarations                                                 */   struct node *pnewnode; /* pointer new node want add       */   struct node *ptemp;    /* temp pointer walking through list    */    /* allocate space our new node , initialize member variables   */   pnewnode = malloc(sizeof(struct node));   pnewnode->number = value;   pnewnode->next = null;    /* sets ptemp head pointer, don't mess              */   ptemp = *list;    /* while we're not @ end of list                                */   while(ptemp->next != null)   {     /* go next entry in list                                    */     ptemp = ptemp->next;   }    /* have previous end of list point @ new end of list    */   ptemp->next = pnewnode;   

}

the specific error message i'm getting "0 [main] list 3384 cygwin_exception::open_stackdumpfile: dumping stack trace list.exe.stackdump"

i tried looking @ stackdump file try , gain insight, i'm not sure how interpret it.

edit: here pastebins 2 other functions possibly causing error.

  1. http://pastebin.com/8y1kkqj2

  2. http://pastebin.com/8rpuy1jv

edit2 here pastebin teacher's main function calling functions

http://pastebin.com/1wiblgay


Comments

Popular posts from this blog

javascript - Wordpress slider, not displayed 100% width -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -