Re: [Dev-C++] what's the (practical) diff?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-01-05 19:00:20
|
Doesn't matter so much. It is mostly a matter of preference. The enum has
the advantage of being a data type.
C programmers has normally used the #define method. C++ affeciendos have a
tendancy to hate #define and obviously thinking enum is the only allowed
way.
Slight note 1: You forgot the zero in "#define FALSE 0"
Slight note 2: Use #define and not #def
/Per W
On Mon, 5 Jan 2004, P.T. Waugh MA wrote:
> What are the practical reasons for choosing one over the other?
>
> This:
>
> // Using enum
> //
> enum Boolean {false, true};
>
> vs.:
>
> // Using cpp object macros
> //
> #ifndef FALSE
> #define FALSE
> #endif
>
> #ifndef TRUE
> #def TRUE 1
> #endif
>
> Not sure I understand why one would choose one over the other.
>
> Patrick
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|