TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Griffon Chan
from: David Nugent
date: 1995-08-28 00:54:32
subject: PROBLEM IN C++

> > No, it can be an array. But unless it really needs to be part of
 > > every class instance, why not simply make it 'static'?

 > yeS, mAkiNg it StAtiC will Solve the pRoblem, but the
 > trouble is I have to create several separate classes.
 > What should I do?

If the classes are related (as I would guess that they are if they are to
access some data in a particular way), then if derived classes need access
to the static data, then make it 'protected' or 'public'. If they aren't
related (why aren't they? Do they describe the same or similar
"things"?), then just make it a global variable.

  David

---
* Origin: Unique Computing, Melbourne, Australia (3:632/348)
SEEN-BY: 50/99 620/243 623/630 632/103 348 998 633/371 634/384 388 635/301
SEEN-BY: 635/502 503 544 727 639/100 711/401 409 410 430 510 807 808 809 932
SEEN-BY: 711/934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 632/103 348 635/503 50/99 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

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