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.
print the address of the object that ptr points to
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
used in arrays. returns the address of array[0 + 1].
that is array
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
moves ptr up 1 address and returns
value at new address. so if object was *(ptr + 2) or
array would return *(ptr + 3) or array where
array = 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.