fork download
  1. class C {
  2. public:
  3. int x;
  4. };
  5.  
  6. struct S : C {};
  7.  
  8. int main() {
  9. S s;
  10. s.x; // Accessible, since S is declared with the struct keyword,
  11. // even though C was declared with the class keyword.
  12. return 0;
  13. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty