Well,p points to address of variable sum and when we change value of
*p,then it change value at that address,thats why u got this output.

On 1/2/12, Shoubhik <[email protected]> wrote:
>
> int main()
> {
>         int const sum=100;
>         int *p=&sum;
>
>         *p=101;
>
>
>         printf("%d, %d",*p,sum);
>         return 0;
> }
>
> /*
>
> output
>
> 101, 101
>
> */
>
> p points to a constant integer variable, then why/how does *p manage
> to change the value of sum?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" 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/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" 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/google-code?hl=en.

Reply via email to