So, if I just added "delete pMem" to main,
everything would be okay?
I thought there was some deeper reason than that.
The book was talking about things like functions
returning references to variables that go out
of scope, and how that's a bad thing... It got
kind of confusing.
The only thing wrong with this is that delete
wasn't called on main's pMem variable?
And that's the only reason why there is a
memory leak?
Thanks a lot.