On Oct 28, 12:39 pm, Markus Pitha <newsgroupsNOS...@pithax.netwrote:
James Kanze wrote:
Objects allocated with new are only destroyed by delete. If you
only need them in berechneEigenschaften, then they should
probably be local variables of the function, not members at all.
Actually I also need it out of this method and I'm not sure at the
moment why I used them as pointers. When my program is finished, I will
examine my code more closely again.
I fear that that (and your response to Kai-Uwe) have it
backwards. These are things you have to do before even starting
to write the code. Define carefully what the class is to do,
and don't write code until you have that done.
As Kai-Uwe pointed out, if a class X has pointers to other class
X, then you have effectively defined a graph. Which may not be
what you meant to do.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34