<p>In my browsings amongst the Internet, I came across <a href="http://www.reddit.com/r/programming/comments/6y6lr/ask_proggit_which_is_more_useful_to_know_c_or_java/" rel="nofollow noreferrer">this post</a>, which includes this</p>

<blockquote>
  <p>"(Well written) C++ goes to great
  lengths to make stack automatic
  objects work "just like" primitives,
  as reflected in Stroustrup's advice to
  "do as the ints do". This requires a
  much greater adherence to the
  principles of Object Oriented
  development: your class isn't right
  until it "works like" an int,
  following the "Rule of Three" that
  guarantees it can (just like an int)
  be created, copied, and correctly
  destroyed as a stack automatic."</p>
</blockquote>

<p>I've done a little C, and C++ code, but just in passing, never anything serious, but I'm just curious, what it means exactly?</p>

<p>Can someone give an example?</p>

Variables in C++ can either be declared on the stack or the heap. When you declare a variable in C++, it automatically goes onto the stack, unless you explicitly use the new operator (it goes onto the heap).
```
```
MyObject x = MyObject(params); // onto the stack

MyObject * y = new MyObject(params); // onto the heap
```
```
This makes a big difference in the way the memory is managed. When a variable is declared on the stack, it will be deallocated when it goes out of scope. A variable on the heap will not be destroyed until delete is explicitly called on the object.