Hi,

I am relatively new to C++. I found this piece of code in a project I am working on. Somebody else wrote it. I have never seen this kind of syntax before and I am curious to know more about it:

class A { bool flag; };
class B { A a1, a2, a3; };

/* this is the syntax i haven't seen before */
A B::* arrayname[3] = {&B::a1, &B::a2, &B::a3};

B b;
...
/* and this is how to use it */
if ((b.*arrayname[0]).flag) ...


Thank you.