Advertisement
toncaa

pset5, cs50

Jan 22nd, 2015
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. void clearMem(node* n)
  2. {  
  3.        
  4.         for(int i=0;i<27;i++)
  5.                 if(n->children[i]!=NULL)
  6.                      clearMem(n->children[i]);
  7.                
  8.             free(n);
  9.             n=NULL;
  10. }
  11. bool unload(void)
  12. {
  13.    
  14.     // TODO
  15.     if(base!=NULL)
  16.        clearMem(base);    
  17.     return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement