Jump to content

What is garbage collection?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
DevilsCharm

DevilsCharm

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 884 posts
I know little about C#, but what is garbage collection? It sounds like an interesting concept and I would like to understand it.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Garbage collection is a language feature that takes care of cleaning up memory for you when pointers, etc go out of scope.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Guest_Kaabi_*

Guest_Kaabi_*
  • Guests
Does C++ have that feature too? Is it very helpful?

#4
oppo

oppo

    Newbie

  • Members
  • PipPip
  • 11 posts
Managed C++ has the garbage collector. This is a MS Visual Studio thing. It frees the programmer from worrying about things such as deleting pointers and memory leaks.

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
There are libraries that offer tools such as "smart pointers" to give C++ that functionality. It is not part of the language itself.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog