www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/07/19:50:53

From: "Pavlos" <trash24379 AT usa DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Classes and Structs, can someone please help?
Date: Sat, 8 May 1999 02:21:19 +0300
Organization: An OTEnet S.A. customer
Lines: 26
Message-ID: <7gvsgb$ic6$1@newssrv.otenet.gr>
References: <926117853 DOT 478 DOT 55 AT news DOT remarQ DOT com>
NNTP-Posting-Host: dram-a04.otenet.gr
X-Trace: newssrv.otenet.gr 926119243 18822 195.167.113.227 (7 May 1999 23:20:43 GMT)
X-Complaints-To: abuse AT otenet DOT gr
NNTP-Posting-Date: 7 May 1999 23:20:43 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Try it this way.
Of course, you have to save it as a .CPP file, not just .C

class book
{
   public:
      int pages;
      int current_page;
      int isopen;

      void open()
      {
         isopen = true;
      }

};

int main()
{
   book wizard_of_oz;
   wizard_of_oz.open();
}




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019