Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!pacbell!hoptoad!hsfmsh!mhyman From: mhyman@hsfmsh.UUCP (Marco S. Hyman) Newsgroups: comp.lang.c++ Subject: A question of style Keywords: define const enum Message-ID: <1148@hsfmsh.UUCP> Date: 31 Jul 89 16:50:28 GMT Reply-To: mhyman@hsfmsh.UUCP (Marco S. Hyman) Organization: SoftCom, Inc. San Francisco Lines: 25 This may be more than a question of style.... There are three ways I can define literal values of type int in C++. Example: #define lit val const lit = val; enum { lit = val }; Using anonymous enums to group related constant values appeals to me because it adds a touch of documentation -- the implication is that the values are somehow related. Any problems here? What are the pros and cons of the three methods? Is there some reason for NOT using a particular method? None of the questions is of real importance but I'm hoping that those of you that have given the matter some thought will share those thoughts with the net. --marc -- //Marco S. Hyman //UUCP: ...!sun!sfsun!hsfmsh!mhyman //Domain: sfsun!hsfmsh!mhyman@sun.com