Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 10:07
Neville Franks3-Dec-02 10:07 
GeneralRe: Enum vs #define Pin
Maximilien3-Dec-02 10:09
Maximilien3-Dec-02 10:09 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 10:18
Neville Franks3-Dec-02 10:18 
GeneralRe: Enum vs #define Pin
Tim Smith3-Dec-02 10:42
Tim Smith3-Dec-02 10:42 
GeneralRe: Enum vs #define Pin
Gary R. Wheeler3-Dec-02 15:24
Gary R. Wheeler3-Dec-02 15:24 
GeneralRe: Enum vs #define Pin
Orkun GEDiK3-Dec-02 9:44
Orkun GEDiK3-Dec-02 9:44 
GeneralRe: Enum vs #define Pin
Maximilien3-Dec-02 10:08
Maximilien3-Dec-02 10:08 
GeneralRe: Enum vs #define Pin
Christian Graus3-Dec-02 10:40
protectorChristian Graus3-Dec-02 10:40 
As has been said, const int should be used rather than #define. An enum is a good idea where a number of values are logically grouped together, const *type* should be used where a value is unique. A #define does not pollute any namespace, it does not exist, the preprocessor replaces it with the value. Macros are generally evil, although I once lost a job at least in part because I knew this. I would also wrap any constants I create into a namespace, so the global namespace is unpolluted.


Christian

No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
GeneralRe: Enum vs #define Pin
Jim A. Johnson3-Dec-02 14:29
Jim A. Johnson3-Dec-02 14:29 
GeneralRe: Enum vs #define Pin
Christian Graus3-Dec-02 14:55
protectorChristian Graus3-Dec-02 14:55 
GeneralRe: Enum vs #define Pin
Nick Parker3-Dec-02 15:25
protectorNick Parker3-Dec-02 15:25 
GeneralRe: Enum vs #define Pin
Christian Graus3-Dec-02 15:36
protectorChristian Graus3-Dec-02 15:36 
GeneralRe: Enum vs #define Pin
Nick Parker3-Dec-02 16:06
protectorNick Parker3-Dec-02 16:06 
GeneralRe: Enum vs #define Pin
Christian Graus3-Dec-02 16:11
protectorChristian Graus3-Dec-02 16:11 
GeneralRe: Enum vs #define Pin
Nick Parker3-Dec-02 16:45
protectorNick Parker3-Dec-02 16:45 
GeneralRe: Enum vs #define Pin
Christian Graus3-Dec-02 16:47
protectorChristian Graus3-Dec-02 16:47 
GeneralRe: Enum vs #define Pin
Anonymous3-Dec-02 10:42
Anonymous3-Dec-02 10:42 
GeneralRe: Enum vs #define Pin
Anonymous3-Dec-02 10:45
Anonymous3-Dec-02 10:45 
GeneralRe: Enum vs #define Pin
Jörgen Sigvardsson3-Dec-02 11:58
Jörgen Sigvardsson3-Dec-02 11:58 
GeneralRe: Enum vs #define Pin
Brad Bruce3-Dec-02 13:00
Brad Bruce3-Dec-02 13:00 
Generalthread pool Pin
gringo3-Dec-02 8:41
gringo3-Dec-02 8:41 
GeneralRe: thread pool Pin
valikac3-Dec-02 9:00
valikac3-Dec-02 9:00 
GeneralRe: thread pool Pin
Daniel Turini3-Dec-02 9:22
Daniel Turini3-Dec-02 9:22 
Generalcreating .wav files Pin
chrishall33-Dec-02 8:32
chrishall33-Dec-02 8:32 
GeneralRe: creating .wav files Pin
Selevercin3-Dec-02 11:44
Selevercin3-Dec-02 11:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.