I was wondering if someone could tell me the difference between:
MyClass class;
And
MyClass *myClass;
myClass = new MyClass();
Other than the second block of code is making a dynamic memory allocation and that I must delete it when I'm done with it otherwise I'll suffer memory leaks.
But what I mean is which one should I be using the most? Does it matter even?
Would it be bad to have all of my custom classes created using the dynamic memory way?