Its 2 2 on gcc compiler. Some compilers support overwriting of the const variables which is usually a bug if program expects the value of a variable to be constant . Usually newer compilers don't show such bugs.
On Sun, Aug 21, 2011 at 8:59 PM, Sanjay Rajpal <[email protected]> wrote: > i was also amazed to see the mystery behind 'const' keyword. > > > Sanju > :) > > > > On Sun, Aug 21, 2011 at 8:27 AM, shady <[email protected]> wrote: > >> woh, thought provoking, it giving 2 2 when there is not const >> i think it has something to do with how 'const' modifies the behaviour of >> storage >> >> >> On Sun, Aug 21, 2011 at 8:33 PM, Kamakshii Aggarwal < >> [email protected]> wrote: >> >>> But on dev c it is showing o/p as 2 2 .. >>> I too have a doubt,a similar question was asked in atrenta's written >>> paper. >>> >>> >>> On Sun, Aug 21, 2011 at 8:14 PM, Ankur Khurana <[email protected] >>> > wrote: >>> >>>> can somebody please explain this ? >>>> >>>> >>>> On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta < >>>> [email protected]> wrote: >>>> >>>>> http://www.ideone.com/kRaMj >>>>> >>>>> I found this in the algogeeks forum only. Can anyone explain how value >>>>> of i is still 0, but *p shows 2 although their addresses are the same. >>>>> >>>>> -- >>>>> Nikhil Gupta >>>>> >>>>> -- >>>>> 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. >>>>> >>>> >>>> >>>> >>>> -- >>>> Ankur Khurana >>>> Computer Science >>>> Netaji Subhas Institute Of Technology >>>> Delhi. >>>> >>>> -- >>>> 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. >>>> >>> >>> >>> >>> -- >>> Regards, >>> Kamakshi >>> [email protected] >>> >>> -- >>> 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. >>> >> >> -- >> 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. >> > > -- > 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. > -- Regards Rajeev N B <http://www.opensourcemania.co.cc> "*Winners Don't do Different things , they do things Differently"* -- 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.
