TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BENJAMIN L MCGEE
from: DARIN MCBRIDE
date: 1997-07-10 20:08:00
subject: FIRST C++ PROG

 -=> Quoting Benjamin L Mcgee to Thomas Maeder
 TM> Don't  use  #define  for  anything  else  than  conditional 
 TM> compiling... 
 TM> Better write 
 TM> const unsigned int WHEEL_MAX = 13; 
 TM> const unsigned int STARTING_CASH = 300; 
 BLM> 
 BLM> I agree, clearly a better way. 
 BLM> 
 BLM> I once had a guy tell me that constants are a waste of code space.  I
 BLM> still think they are very useful, without regard to the language you 
 BLM> happen to be using.  Knowing the best way to define constants is 
 BLM> altogether a different thing. :)
There are three cases here.
1) extern const  ;
  // uses code space
2) const  ; /* in C, not C++ */
  /* uses code space */
3) const  ; // in C++, not C
  // only uses code space if you try to take its address
Hope this helps.  :-)
... Open mouth, insert foot, echo internationally.
___ Blue Wave/OS2 v2.30
--- FastEcho 1.46
---------------
* Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536)

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