due to constant folding

On Jul 4, 6:54 am, Navneet Gupta <[email protected]> wrote:
> If you can, refer to "Constants" chapter in Bruce Eckel. He he smartly
> explained how const are different for C & C++.
>
> The e-book is free to download from net.
>
>
>
>
>
>
>
>
>
> On Mon, Jul 4, 2011 at 2:50 AM, Gene <[email protected]> wrote:
> > Why do bicycles have 2 wheels and tricycles 3?  The designers made
> > them that way.
>
> > So you're probably asking why they were designed that way.
>
> > C++ came after C.  In general C++ seeks to de-emphasize use of the pre-
> > processor because macro substitution is generally considered to make
> > maintenance more difficult.
>
> > Consequently, in C you would say
> > #define ArraySize 100
> > and this will work in C++, too.  But C++ gives you the addtional
> > "preferred" way.
>
> > On Jul 3, 4:17 pm, Deoki Nandan <[email protected]> wrote:
> >> WHY?
> >> In C++, you can do something like
>
> >> const int ArraySize = 100;
> >> int Array[ArraySize];
>
> >> while in ANSI C, this would be flagged as an error.
>
> >> --
> >> **With Regards
> >> Deoki Nandan Vishwakarma
>
> >> *
> >> *
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Algorithm Geeks" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/algogeeks?hl=en.
>
> --
> --Navneet

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to