i have a nested struct and i\'d like to have a pointer-to-member to one of the nested member:
is it legal?
struct InnerStruct
{
bool c;
};
struct
The InnerStruct you care about happens to be contained in an instance of a MyStruct, but that doesn't affect how you get a pointer to the member of the InnerStruct.
bool InnerStruct::* toto2 = &InnerStruct::c;
Edit: Rereading your question, I'm guessing you want to define a pointer to member of the outer struct, and have it point directly at a member of the inner struct. That's simply not allowed. To get to the member of the inner struct that's contained in the outer struct, you'd have to create a pointer to the inner struct itselft, then to its member. To use it, you'd dereference both pointers to members:
// Pointer to inner member of MyStruct:
InnerStruct MyStruct::* toto = &MyStruct::inner;
// Pointer to c member of InnerStruct:
bool InnerStruct::* toto2 = &InnerStruct::c;
// Dereference both to get to the actual bool:
bool x = mystruct.*toto.*toto2;