Assuming that MyClass is a custom class with a custom default constructor, and that this is in C++... What is the difference between these 3 ways of initializing a MyClass object?
MyClass myObj;
MyClass* myObj = new MyClass;
MyClass* myObj = new MyClass();
What I already know: I know that the first object exists solely in the stack, whereas the following two objects are allocated on heap memory. I know that the two last objects are stored in pointer variables, and so calling functions would require using "->" instead of the dot operator.
Are there any other differences?