I don't understand why can you do this:
Employee *emp;
if (condition1)
emp = new Employee();
else if (condition2)
emp = new Manager();
but not this:
Employee emp;
if (condition1)
emp = Employee();
else if (condition2) {
emp = Manager();
Maybe this is a TERRIBLE idea, but it seems to me if you don't use pointers then you never have memory leak type problems... but the language disallows you from NOT using pointers in cases like this.
Any comments?
Thanks,
Dave