Tuesday, November 16, 2010

Struct

The following code compileS:

   struct MyStruct {int i;};
   struct MyStruct2 : MyStruct {int i;};
   int main() {
      MyStruct2 s2;
      s2.MyStruct::i = 43;
      return 0;
   }

The default access specifier for a struct base class is public.

No comments:

Post a Comment