home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!udel!sbcs.sunysb.edu!engws10.ic.sunysb.edu!jcontro
- From: jcontro@engws10.ic.sunysb.edu ()
- Subject: Help!!!!!!!!!!!!
- Message-ID: <1992Dec12.184235.29056@sbcs.sunysb.edu>
- Originator: jcontro@engws10.ic.sunysb.edu
- Sender: usenet@sbcs.sunysb.edu (Usenet poster)
- Nntp-Posting-Host: engws10.ic.sunysb.edu
- Organization: State University of New York at Stony Brook
- Date: Sat, 12 Dec 1992 18:42:35 GMT
- Lines: 24
-
- Hello--
-
- I wonder if there is anyone out there who can answer a quick question:
-
- In a function, I declare a pointer to a structure, say:
- SOME_STUCT *Ptr;
-
- let SOME_STRUCT have a field which contains a Next pointer, etc...
-
- I pass it to a function, like this :
-
- fn( ..., Ptr );
-
- recieve it like : fn( SOME_STRUCT *Ptr ) { ...
-
- The problem is that inside the funciton I create a linked list,
- of which Ptr is the head. I know it does this correctly.
- But, when the function returns, the space is lost, I think. Is it
- because I allocated it locally??
- And if so, how is it that you return a linked list from a function>?????
-
- Thanx -- I really need it.
- Jacqueline.
-
-