From: Leo <leonardo@dinamicmultimedia.es>
To: axp-list@redhat.com
Subject: Re: Any C++ on Alpha gfurus out there?
Date: Mon, 16 Nov 1998 15:43:40 +0100 [thread overview]
Message-ID: <36503A1C.20C4140@dinamicmultimedia.es> (raw)
In-Reply-To: 19981116084516.A15882@xcski.com
Paul Tomblin wrote:
> Quoting Stefan Schroepfer (scr@iis.fhg.de):
> > Brian E.W. Wood wrote:
> > >
> > > _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action;
> >
> > I'm definitely not a C++ guru, but please can someone
> > explain me
> > - Where is the l-value in that line? For what concept will
> > I have to search in Stroustroup (after I got mine back)?
> > - Why does one write such a counter-intuitive construct
> > even if it is a valid one?
>
> What's so hard to understand? _wd is obviously a class or a typedef. wd is a
> pointer to that class. m_menuFactoryItems is an array of structs or class
> instances, which has a data field (or method) of type (pointer to _wd) called
> callback_action.
>
> If you find this counter-intuitive, you should stick to simple languages like
> VB.
>
What is hard to understand is the so l-value there; can't see any!?
I suppose the line should be:
(_wd *) wd = (_wd *)m_menuFactoryItems[k].callback_action;
If this is the case, there is no l-value here.
If you want this to compile, you should write:
(_wd * &) wd = (_wd *)m_menuFactoryItems[k].callback_action;
Now the l-value is the expression on the left of the = sign.
Under Stroustroup, You should look for l-value in the index, or the references
section, I guess.
Leo
next prev parent reply other threads:[~1998-11-16 14:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-13 19:10 Any C++ on Alpha gfurus out there? Brian E.W. Wood
1998-11-13 19:17 ` Nicholas Sallembian
1998-11-13 19:25 ` B. James Phillippe
1998-11-13 21:48 ` Nicholas Sallembian
1998-11-14 1:06 ` Bob McElrath
1998-11-14 13:20 ` sterwill
1998-11-14 17:37 ` Brian E.W. Wood
1998-11-13 19:26 ` Anders Hammarquist
1998-11-13 19:37 ` Heinz Ulrich Stille
1998-11-16 3:50 ` Michael J. Donahue
1998-11-16 13:15 ` Stefan Schroepfer
1998-11-16 13:45 ` Paul Tomblin
1998-11-16 14:24 ` Stefan Schroepfer
1998-11-16 14:43 ` Leo [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-11-16 14:49 Leo
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox