Sender: pgg AT hq DOT obop DOT com DOT pl Message-ID: <353C4927.123E9735@usa.net> Date: Tue, 21 Apr 1998 09:22:15 +0200 From: "Przemyslaw G. Gawronski" Reply-To: gawronskip AT usa DOT net Organization: take it easy MIME-Version: 1.0 To: loren CC: djgpp AT delorie DOT com Subject: Re: OOP with DJGPP References: <353B38BC DOT 6C688A2D AT seric DOT es> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Precedence: bulk loren wrote: > I'm trying to declare some OOP classes in DJGPP but ... > it doesn't works!!!!! =8-/ > Does DJGPP support Object-Oriented Programming? > Why this: > > class MyClass { > int my_var; > MyClass(); > ~MyClass(); > } > > Doesn't works? Yes it does !!! By default all members after the '{' of a class are private. Class user doesn't have access to them. So it would be inposible to make an instance of such a class since the constructor is private. To make it work You have to make the constructor public. This should work fine: class MyClass { int my_var; public: MyClass(); ~MyClass(); } Good luck Przemek -- /----------------------------------------------------\ | Przemyslaw G. Gawronski mailto:gawronskip AT usa DOT net | | ICQ:8358522 | \----------------------------------------------------/