Hi Rahul,
All it is saying is that you can do simple arithmetic on pointers
directly which modified the address it is pointing to.
Suppose you have an array of int type (int arr[10];)then you can
access elements of the array in following ways:
1. arr[1], arr[4] etc.
2. arr+1, arr+4 etc. as arr is also address of first element and being
int type will increment in int size.
3. int *p = arr; or int *p = arr[0] // here we created a pointer to
integer and point it to first element of array
    p+1 will point to second element of arr and *(p+1) will be the
content of arr[1]

on the other hand if you declare your pointer as any other type than
the array type itself, you can access each bytes within the element
too
so for above example "arr" which is of type int
char *p = arr; or char *p = arr[0]; // this will create a pointer to
character (1 byte) while "arr" is an integer array so now,
p+1 will point to second byte of arr[0]
let's say integer is 4 bytes then to go to start of each element of
array using such p will be done as:
p - points to first element's first byte (depends on big-endian/little-
endianness of machine)
p+4 - points to second element's first byte
p+8 - points to third element's first byte
and so on.

Hope this helps.
Kapil.

On Sep 28, 11:04 pm, rahul rai <raikra...@gmail.com> wrote:
> http://ocw.mit.edu/courses/electrical-engineering-and-computer-scienc...
>
> Thanking In Advance
> --
> Rahul K Rai
> "And The Geek Shall Inherit The Earth"

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to