TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KEVIN CAMPBELL
from: PAUL WANKADIA
date: 1997-06-21 11:53:00
subject: Borland Builder

On 15 Jun 97, Kevin Campbell wrote to Paul Wankadia --
 > if (stricmp(demo.size, "huge")) {
 >         for (loop = 0 ; loop < 1275 ; loop++) phone.cost++
 > }
 KC> Looks fine. What is the structure for Demo and Phone, and what is loop
 KC> defined as (int/char)?
 KC> Oh, and you've missed a semi-colon right after phont.cost++
Sorry 'bout that.  I think I'll revise the whole thing :
=====
#include 
class Demo {
     private:
          long size;
     public:
          Demo(long);
          long get_size() { return size; }
};
Demo::Demo(long new_size) {
     size = new_size;
}
class Phone_bill {
     private:
          float cost;
     public:
          Phone_bill();
          increment_cost() { cost += UNIT_COST; }
};
Phone_bill::Phone_bill() {
     cost = 0.00;
}
int main() {
     Demo demo(HUGE);
     Phone_bill phone_bill;
     if (demo.get_size() == HUGE) {
          for (int loop = 0 ; loop < 1275 ; loop++)
               phone_bill.increment_cost();
     }
     return 0;
}
--- PPoint 2.00
---------------
* Origin: Junyer's Workshop (3:640/772.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.