Yup it was due to compiler optimization.....check this link now,,,
http://ideone.com/f7keg

On Sun, Aug 7, 2011 at 8:02 AM, saurabh singh <[email protected]> wrote:

> The value of a has changed but it doesnt appears so...Thats bcoz the
> compilers are smart enough in dealing with const variables...The value has
> changed but doesnt appears so when you print it.....
>
>
> On Sun, Aug 7, 2011 at 1:15 AM, Jyoti Gupta <[email protected]> wrote:
>
>> but how do they both point to same address location ??
>>
>>
>> On 7 August 2011 01:05, jagrati verma <[email protected]>wrote:
>>
>>> thanku all.....................
>>>
>>> On Sun, Aug 7, 2011 at 12:58 AM, Debabrata Das
>>> <[email protected]> wrote:
>>> > try this:
>>> > const int a=54;
>>> >        int *p=(int *)&a;
>>> >        *p=100;
>>> >        printf("%d\n",*p);
>>> >        printf("%x %x",p,&a);
>>> >
>>> >
>>> >
>>> > On Sun, Aug 7, 2011 at 12:28 AM, UTKARSH SRIVASTAV
>>> > <[email protected]> wrote:
>>> >> yes saurabh the value of a has not changed
>>> >>
>>> >> On Sat, Aug 6, 2011 at 11:20 AM, aditi garg <
>>> [email protected]>
>>> >> wrote:
>>> >>>
>>> >>> @saurabh
>>> >>> http://ideone.com/J0gNi
>>> >>> its jst pointing to same address bt it has not modified the
>>> value...chk
>>> >>> the abv link...
>>> >>> On Sat, Aug 6, 2011 at 8:13 PM, saurabh singh <[email protected]>
>>> wrote:
>>> >>>>
>>> >>>> http://ideone.com/Wszkg
>>> >>>> On Sat, Aug 6, 2011 at 8:03 PM, jagrati verma
>>> >>>> <[email protected]> wrote:
>>> >>>>>
>>> >>>>> how can modify constant variable with the help of pointers.
>>> >>>>>
>>> >>>>> --
>>> >>>>> 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.
>>> >>>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> Saurabh Singh
>>> >>>> B.Tech (Computer Science)
>>> >>>> MNNIT ALLAHABAD
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> 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.
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Aditi Garg
>>> >>> Undergraduate Student
>>> >>> Electronics & Communication Divison
>>> >>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>> >>> Sector 3, Dwarka
>>> >>> New 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.
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> UTKARSH SRIVASTAV
>>> >> CSE-3
>>> >> B-Tech 3rd Year
>>> >> @MNNIT ALLAHABAD
>>> >>
>>> >> --
>>> >> 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.
>>>
>>>
>>
>>
>> --
>> Jyoti Gupta
>> COE , 4th year
>> Delhi College of Engineering
>>
>>  --
>> 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.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>


-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
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