|
Ah, I see. I appear to have misunderstood the question and simultaneously
classed you as a newbie :).
Anyway, as far as I'm aware this is a C++ only operator. Here's a snippet of
code that uses it:
class Foo {
public:
void A(int x) { printf("A=%i\n", x); }
void B(int x) { printf("B=%i\n", x); }
};
typedef void (Foo::* foo_fn_t) (int x);
int main()
{
Foo f;
foo_fn_t func = &foo::A;
(f.* func)(123);
func = &foo::B;
foo *pf = &f;
(pf->* func)(456);
return 0;
}
Outputs:
A=123
B=456
Essentially, you use them to dereference a pointer to a member function (or
property) before the indirection operator.
Sorry, for the implied insult....
Steve.
-----Original Message-----
From: Gene_Gaunt@ReviewWorks.com [mailto:Gene_Gaunt@ReviewWorks.com]
Sent: 26 July 2002 13:54
To: c400-l@midrange.com
Subject: RE: [C400-L] dot-indirection and arrow-indirection operators?
Thanks Steven, but what are dot-indirection and arrow-indirection
operators??? They appear in chapter 5's operator precedence and
associativity table at rank level "4" (below dot and arrow operators at
rank level "2").
_______________________________________________
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/c400-l
or email: C400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.