1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What is the purpose of realloc( )?

Discussion in 'C' started by sunina, Feb 15, 2007.

  1. sunina

    sunina New Member

    Joined:
    Jan 31, 2007
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    # What is the purpose of realloc( )?
     
  2. samsmile007

    samsmile007 New Member

    Joined:
    Feb 15, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    # if we run out of allocated memory during the run-time of our program and need to give our collection of items more memory
    # Enter realloc(3), it's prototype:

    void *realloc(void *ptr, size_t size);

    realloc takes in the pointer to the original area of memory to enlarge and how much the total size should be
     

Share This Page