Thread: Difference malloc and delete

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    46

    Difference malloc and delete

    Hi
    Wich allocator is better to use malloc -free or new-delete?? What is the differences between them anyway? I mean in theory and not in syntax
    Thanks

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    One is C, one is C++. You posted on a C board, use malloc/free.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    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. Delete Function in Doubly Linked List
    By Dampecram in forum C Programming
    Replies: 5
    Last Post: 11-15-2008, 04:30 PM
  2. delete an element from a linked list
    By hinman in forum C Programming
    Replies: 6
    Last Post: 10-17-2007, 08:30 PM
  3. malloc & free in C vs. new & delete in C++
    By groberts1980 in forum C Programming
    Replies: 20
    Last Post: 10-17-2006, 10:00 PM
  4. BinaerTree Sorting....How to delete ?
    By Gugge in forum C Programming
    Replies: 7
    Last Post: 08-22-2002, 10:49 AM
  5. memory management...
    By master5001 in forum Game Programming
    Replies: 24
    Last Post: 01-07-2002, 05:50 PM