Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!polyslo!ttwang From: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Newsgroups: comp.lang.c++ Subject: call constructors explicitly Message-ID: <1989Oct12.201915.28377@polyslo.CalPoly.EDU> Date: 12 Oct 89 20:19:15 GMT Reply-To: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Distribution: usa Organization: Cal Poly State University -- San Luis Obispo Lines: 19 I forgot how to call a constructor explicitly. Can someone e-mail me the answer? int spc[1024]; main() { foo* obj = (foo*) spc; obj->foo(); // foo::foo() is constructor obj->print(); } This example blows up in AT&T cfront. Is there another way that is portable? -Thomas Wang ("This is a fantastic comedy that Ataru and his wife Lum, an invader from space, cause excitement involving their neighbors." - from a badly translated Urusei Yatsura poster) ttwang@polyslo.calpoly.edu