void f(const Fraction& a)
{ Fraction b = a;
Fraction* c = new Fraction(3, 4);
Fraction* d = &a;
Fraction* e = new Fraction(7, 8);
Fraction* f = c;
delete f;
}
Which values do I delete? I think I only delete c which is dynamically allocated and rest of the objects are destroyed automatically when the function ends.
How about e? It is also dynamically allocated but we don't have any delete operator for e. The e is not de-allocated?
Thanks,