TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: JAVIER KOHEN
date: 1997-05-18 18:00:00
subject: Creating workable subcla

Javier Kohen to Masingill. Ensign:
On stardate 13-May-97, Frank Masingill established a sub-space link to Cliff 
Rhodes refering to Creating workable subcla.
 FM> class Calc
 FM> {
 FM>         int Add(void);        //member function to compute sum
 FM>         int Subtract(void);   //member function to compute difference
 FM>         int Multiply(void);   //member function to compute product
 FM>         float Divide(void);     //member function to compute quotient
 FM> };
 FM>     Your critique and that of anybody else who reads will be 
appreciated. 
 FM>  Did I make ANY progress?
You sure did! Maybe now you can add a member calc() that does all the
operations and stores the results in private vars, so when you use Add(),
Sub() and so, many times, you do not have to calc everything again.
Ie:
Calc a(1,2);
for (int i = 1; i <= 10; i++)
        printf("%d - %d\n", i, a.Add());
Will run faster if you precalc N1 + N2.
BTW: could anybody give me a simple excercise? I can't remember the last
time I wrote a program in C++...
Internet: jkohen@tough.com * Fidonet: 4:900/748.3 * Sk-Network: 200:201/201.2
                          -=[ PGP keyID 3423EAA9 ]=-
... Don't repeat your parents mistakes: use a condom!
-!- CrusherTag 0.02.
--- Terminate 4.00/Pro
4:900/748.3)
---------------
* Origin: The King of The Ring BBS þ +54-1-OFF-LINE þ TLD 0 - 7

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™.