let me keep it simple

 y is integer pointer pointing to address 20 .. x=20

y+7 will point to the address    y + ( size(int) * 7)     i.e  50 here
    /*y is integer pointer*/

On Tue, Nov 6, 2012 at 11:45 AM, Rahul Kumar Patle <
[email protected]> wrote:

> because difference is of 30 bytes..
> and integer takes 4 byte...
> it is representing that there are 7 int blocks between the address x and y
> output will be same as 7 for 31, 30, 29, 28.
>
> 2012/11/6 rajesh pandey <[email protected]>
>
>> *int *x ,int *y;
>> x=(int *) 50;
>> y=(int *)20;
>> cout<<x-y<<endl;
>>
>> why the output is 7.*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/wgVXAzGRgU4J.
>> 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.
>>
>
>
>
> --
> Thanks and Regards:
> Rahul Kumar Patle
> M.Tech, School of Information Technology
> Indian Institute of Technology, Kharagpur-721302, 
> India<http://www.iitkgp.ac.in/>
> Mobile No: +91-8798049298, +91-9424738542
> Alternate Email: [email protected]
> [image: 
> Linkedin]<http://www.linkedin.com/profile/view?id=106245716&trk=tab_pro>
> [image: Twitter] <https://twitter.com/rahulkumarpatle>
> <https://www.facebook.com/rkpatle>
>
>  --
> 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.
>



-- 
*Thanks & Regards,*
*Vishwa*
*+91 9964051504*

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