pointer notation and array notation:
=========================================
int *ptr - pointer to integer. allocates enough memory to store
a variable of size integer.
ptr = &variable
assignes addy of variable to pointer.
printf("%p", ptr);
print the address of the object that ptr points to
printf("%d", *ptr);
print the value of the object that ptr points to
*ptr + 1 or (*ptr) + 1
adds 1 to the value of the object that ptr points to
*(ptr + n) same as array[n]
used in arrays. returns the value at array[n]. tecnically
moves up the address of the object that ptr points to n
times then references/returns the value there.
ptr + 1 same as &array[1]
used in arrays. returns the address of array[0 + 1].
that is array[1]
&ptr
returns the address of the actual pointer variable itself
*ptr++ or *(ptr++) or &array[n] + 1
increments the address of the variable ptr points to.
subsequently returning the value stored at array[n] + 1
*++ptr
moves ptr up 1 address and returns
value at new address. so if object was *(ptr + 2) or
array[2] would return *(ptr + 3) or array[3] where
array[3] = value at array element 2
(*p)++ or array[n] + 1
increment the value ptr pointing to by 1. so same address
but value at addy incremented by 1.