Thread: Freeying Memory

  1. #1
    Registered User
    Join Date
    Feb 2012
    Location
    Bangalore, India
    Posts
    12

    Freeying Memory

    do we need to free memory (free() ) in user defined fucntion if we have allocated using malloc? isn't tha automatically freed when the function returns. Is using free() inside function at all recommended in some special cases?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Dupe -> Freeying Memory
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Freeying Memory
    By durgadatta in forum C Programming
    Replies: 11
    Last Post: 02-13-2012, 08:31 AM
  2. Replies: 12
    Last Post: 04-11-2010, 07:14 AM
  3. Allocate memory inside allocated memory block?
    By Heidi_Nayak in forum C Programming
    Replies: 14
    Last Post: 04-15-2009, 04:19 PM
  4. Finding memory address using memory pattern
    By MindWorX in forum C++ Programming
    Replies: 1
    Last Post: 05-25-2008, 07:20 AM
  5. Replies: 2
    Last Post: 09-28-2006, 01:06 PM

Tags for this Thread