don't take this wrong, but the question was which is preferred,
using #define or typedef to create a new type. You said its preferred
to use typedef (which I agree ) because when using #define the compiler
wouldn't be able to check the types.
I just stated the latter, as false.
Rage wrote:#define a 3
I agree that the 3 doesn't resemble a single type, but that wasn't what i meant.
Rage wrote:..., but const is definitely better than a #define.
I could agree to this if one is writing an application for Computer based systems.
But when writing for embeded systems, where 2MB of memory is already considered to be a luxery,
every byte that you can save by using #defined constants is worthwhile.
And when it comes to MFC there is no such thing as a SIMPLE macros
codito ergo sum