Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!manuel!csc.canberra.edu.au!news From: rvp@softserver.canberra.edu.au (Rey Paulo) Newsgroups: comp.unix.programmer Subject: A "malloc" question Message-ID: <1991Apr25.025403.5617@csc.canberra.edu.au> Date: 25 Apr 91 02:54:03 GMT Sender: Rey V. Paulo Organization: University of Canberra Lines: 20 Can anyone tell me if dynamically allocated storage for automatic variables remains allocated even if the variables have already disappeared after the invocation of the function. If it is, does this mean that "automatic" does not have any meaning at all for dynamically allocated storage? And one more, if I have an automatic variable in a function and I allocate storage for that variable using "malloc", are the following ways of freeing the storage the same? In both cases, assume the variable is (char *str). 1) free (str) - inside the function where str is declared. 2) free (sstr) - inside another function where sstr is declared but made to point to str by a function call. Thanx. -- Rey V. Paulo | Internet: rvp@csc.canberra.edu.au University of Canberra | I am not bound to please thee with my answer. AUSTRALIA | -Shylock, in "The Merchant of Venice" ------------------------------+----------------------------------------------