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)
|