home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18260 < prev    next >
Encoding:
Text File  |  1992-12-12  |  1.1 KB  |  37 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!udel!sbcs.sunysb.edu!engws10.ic.sunysb.edu!jcontro
  3. From: jcontro@engws10.ic.sunysb.edu ()
  4. Subject: Help!!!!!!!!!!!!
  5. Message-ID: <1992Dec12.184235.29056@sbcs.sunysb.edu>
  6. Originator: jcontro@engws10.ic.sunysb.edu
  7. Sender: usenet@sbcs.sunysb.edu (Usenet poster)
  8. Nntp-Posting-Host: engws10.ic.sunysb.edu
  9. Organization: State University of New York at Stony Brook
  10. Date: Sat, 12 Dec 1992 18:42:35 GMT
  11. Lines: 24
  12.  
  13. Hello--
  14.  
  15. I wonder if there is anyone out there who can answer a quick question:
  16.  
  17. In a function, I declare a pointer to a structure, say:
  18.    SOME_STUCT  *Ptr;
  19.  
  20. let SOME_STRUCT have a field which contains a Next pointer, etc...
  21.  
  22. I pass it to a function, like this :
  23.  
  24. fn( ..., Ptr );
  25.  
  26. recieve it like :  fn( SOME_STRUCT *Ptr ) { ...
  27.  
  28. The problem is that inside the funciton I create a linked list,
  29. of which Ptr is the head. I know it does this correctly.
  30. But, when the function returns, the space is lost, I think.  Is it
  31. because I allocated it locally??
  32. And if so, how is it that you return a linked list from a function>?????
  33.  
  34. Thanx -- I really need it.
  35. Jacqueline.
  36.  
  37.