how do i release the memory ocupied by a?

Discussion in 'C' started by ghostonline, May 10, 2011.

  1. ghostonline

    ghostonline New Member

    Joined:
    May 10, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    int x = 10;
    int y = 12;
    int *ax = &x
    int *ay = &y
    int*a = new int;
    int temp;
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Memory allocated with new is freed with delete, and new[] with delete[].
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice