p=(char *)a;
this statement assigns value of 7 to p after type converting to char*,
so as p is a pointer it points to memory location 7

p[b] will give to the value at location 9 same as *(p+b) = *(7 + 2)
just like array
&p[b] will give the address of that location i.e. 9 which is char*
so we type convert to int and assigned to s.


On 6/20/10, jalaj jaiswal <[email protected]> wrote:
> @ above all
>
> i dint get how the value of a and b gets added in s... after p=(char *)a...
> p has 7 in it... but how the value gets added
> thru s=(int)&p[b].... p[b] seems as if p is an array.......... m confused in
> this line .. please explain in a bit detail.. :O
>
> On Sun, Jun 20, 2010 at 4:44 PM, anand verma
> <[email protected]>wrote:
>
>> thanks
>>
>> --
>> 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]<algogeeks%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> With Regards,
> Jalaj Jaiswal
> +919026283397
> B.TECH IT
> IIIT 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.

Reply via email to