Re: References: I need a quick bit of .
> That should NOT compile.
I agree.
You're initialising a _reference_ to non-const
'float' using a _literal_ of type 'int' (the zero).
How can i do this better? The compiler forces me to instantantiate it
or it will throw an error.
If your compiler
does not complain, throw it away and get a better compiler.
I'd love to, but I can't. This is a project for school and I must use
this compiler. It's an old compaq c++ compiler running on an alpha
processor....
>
> Once you do, rethink your decision to store references in your nodes.
> References are very delicate things, they cannot be "re-seated" to refer
> to a different object. Once initialised, they refer to the same object
> as long as they live; assigning to a reference changes the object to
> which the reference refers.
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?
Thanks for your .
Regards,
Ken
|