Thread: do you have to delete the programs

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    2

    do you have to delete the programs

    I have done some programs in rpgcode, and that one you have to delete some of the program or it will just sit on the memory. I just want to know if c and c++ is like that or not. i am new at c++ but i just want to know if you have to delete anything and if anything will just sit on your memory.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    When you end an application in C++, like many other programming languages, the OS will clean the memory up for you. However, in cases of runtime memory allocation, it's proper to call delete on any dynamically allocated memory in your program before closing it. Though, it's rare that not doing so would cause a problem, it's proper programming practice. Any other basic data, the OS will clean up and classes have default destructors, so unless you have to delete something specific in them, the default will suffice to clean that memory up.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    2
    ok tyvm

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Delete opened file
    By gidion in forum C Programming
    Replies: 25
    Last Post: 12-04-2008, 10:35 AM
  2. Delete Function in Doubly Linked List
    By Dampecram in forum C Programming
    Replies: 5
    Last Post: 11-15-2008, 04:30 PM
  3. can we debug into delete
    By George2 in forum C++ Programming
    Replies: 3
    Last Post: 11-20-2007, 05:45 AM
  4. do you have to delete the programs
    By MidnightlyCoder in forum C++ Programming
    Replies: 2
    Last Post: 03-22-2006, 09:02 AM
  5. Problem need help
    By Srpurdy in forum C++ Programming
    Replies: 1
    Last Post: 07-24-2002, 12:45 PM