Re: References: I need a quick bit of .
On Oct 16, 6:54 pm, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:
> xkenneth wrote:
> > [..]
> > I also agree that using references is a little goofy, but I must use
> > the header files given by my professor.
> > Is there any other reason why this wouldn't work?
> You will need to implement pruning and grafting correctly if you're
> forced to use references. And you need to implement construction
> properly (no assignment to 'data', use initialisation only).
He can make it work exactly as if he'd used a simple float by
initializing the reference with a *new float in the constructor,
and adding a delete &data in the destructor. It's stupid to do
so, of course, but since he says the prof. insists.
--
James Kanze (GABI Software) email:james.kanze@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
|