From: horst DOT kraemer AT gmx DOT de (Horst Kraemer) Newsgroups: comp.os.msdos.djgpp Subject: Re: constructor question... Date: Tue, 16 May 2000 04:55:25 GMT Lines: 35 Message-ID: <3920443b.80579546@news.cis.dfn.de> References: <20000515060507 DOT 20515 DOT qmail AT web108 DOT yahoomail DOT com> NNTP-Posting-Host: pc19f6601.dip.t-dialin.net (193.159.102.1) X-Trace: fu-berlin.de 958452805 126071 193.159.102.1 (16 [27606]) X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sun, 14 May 2000 23:05:07 -0700 (PDT), Mohamed Saad wrote: > Hello... > I have a small question... > if i have a class called Txyz... > > what does the following code do? > int main(void) > { > Txyz(); > } > > does this create a nameless instance of the class?? Yes. It creates it and throws it away at the same time. A more "useful" example would be #include struct X { void hello() { cout << "hello\n"; } }; int main() { X().hello(); } Regards Horst