Mail Archives: djgpp/2003/04/24/08:30:07
Ellingworth, Richard <Richard DOT Ellingworth AT uk DOT perrymail DOT com> wrote:
> I *have* tried it with the DJGPP compiler and it doesn't tell me anything.
> It compiles and links just fine but then fails to work properly.
Define "work properly"... the code you showed does nothing at all, so
it cannot do anything properly, either.
Off-hand, I'd suspect that calling the (int) constructor in the (void)
one builds a new instance of the object which is immediately
discarded, but doesn't initialize the actual object you're trying to
construct at all.
You may have to delegate all the actual work to a pseudo constructor
that all the "real constructors" call by its actual method name. Or
just use default arguments and initializer lists, as god intended.
> What I am interested in is why this is the case. Do you know why? My
> text book certainly doesn't tell me (C++ Complete Reference 4th
> edition, Herbert Schildt).
As a rule of thumb: never believe a single word you find in any book
with the name Schildt on it anywhere, unless it's a quote from
somebody else's work. This guy is a world-famous anti-expert --- he
explains things very lucidly, but the facts he explains are almost all
completely wrong.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -