Here's another C++ question that I'm curious about. In Java you only use the new keyword to create an instance of a class but in C++ there are a few ways. You can use
1) MyClass *c = new MyClass();
which returns a pointer to an instance of MyClass and there is
2) MyClass c;
which puts the actual instance of the class in the variable c and then there is
3) MyClass *c;
Both 1 and 3 are pointers to the class... so what's the difference. I know that since the first was created with new you have to later delete it. Why do you need to do this?
When do I use which?