Thread: Cleaning up, deleting variables

  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
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    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, 12:54 AM
  2. Replies: 15
    Last Post: 09-30-2008, 02: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, 03: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