Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!saturn!saturn.ucsc.edu!daniel From: daniel@saturn.ucsc.edu (Daniel Edelson) Newsgroups: comp.lang.c++ Subject: derivation from structs Message-ID: <7103@saturn.ucsc.edu> Date: 12 May 89 21:28:58 GMT Sender: daniel@saturn.ucsc.edu Reply-To: daniel@saturn.ucsc.edu (Daniel Edelson) Organization: University of California, Santa Cruz; CIS/CE Lines: 32 Does derivation from structs rather than classes default to public rather than private, as it is for classes? How about if the struct contains a private part? struct A { int x; }; struct B : A { }; struct C { private: int x; }; struct D : C { }; main() { A * p = new B; // Is this legal? C * q = new D; // Is this legal? } Obviously if this were explicitly public derivation then the initializers would be legal, but does the type of derivation default to public for structs? daniel edelson daniel@saturn.ucsc.edu