On Feb 15, 5:27 pm, yeti
> I have few simple question.
> 1. Why does the constructor and destructor have same name as
> the class it belongs to ??
Because Stroustrup designed it that way. I suspect that the
main motivation at the time was just to avoid introducing new
keywords.
> 2. Why can't constructor and destructor return values ??
How could they? You can't call a constructor directly, and you
don't normally call the destructor directly. So even if they
did have a return value, you'd have no way of accessing it.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34