Cleaning up, deleting variables

This is a discussion on Cleaning up, deleting variables within the C Programming forums, part of the General Programming Boards category; I have an enquiry into C, I'm pretty sure in the past playing around with C++ in bloodshev there being ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    36

    Cleaning up, deleting variables

    I have an enquiry into C, I'm pretty sure in the past playing around with C++ in bloodshev there being a delete keyword that deletes a variable from memory, is this available in ANSI C ?

    Since other languages have this important function, does it exist in some library where I can incorporate it into C.

    undefined reference to `delete'

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    C uses malloc() and free(), whereas C++ uses new() and delete().

  3. #3
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    And if you want to know, malloc(...) and free() are defined in stdlib.h.

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    36
    much appreciated

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. basic question about global variables
    By radeberger in forum C++ Programming
    Replies: 0
    Last Post: 04-06-2009, 01:54 AM
  2. Replies: 15
    Last Post: 09-30-2008, 03:12 AM
  3. esbo's data sharing example
    By esbo in forum C Programming
    Replies: 49
    Last Post: 01-08-2008, 11:07 PM
  4. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 04:25 AM
  5. Cleaning variables for a CGI app (as a derived class?)
    By drrngrvy in forum C++ Programming
    Replies: 1
    Last Post: 02-01-2006, 12:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21