Operations on Pointers in C Programming Language

In C Programming Language, the only operations that can be carried out on pointers are summarized below:

  1. A pointer variable can be assigned the address of an ordinary variable (e.g., pv = &v)
  2. A pointer variable can be assigned the value of another pointer variable (e.g., pv = px) provided both the pointers point to objects of the same data-type
  3. A pointer variable can be assigned a null (zero) value (e.g., pv =NULL, where NULL is a symbolic constant that represents the value 0)
  4. An integer quantity can be added to or subtracted from a pointer variable (e.g., pv + 3, ++pv, etc.)
  5. One pointer variable can be subtracted from another pointer variable provided both pointers point to elements of the same data-type
  6. Two pointer variables can be compared provided both the pointers point to objects of the same data-type

You may also like...

3 Responses

  1. Amit banerjee says:

    sum of two number using function pointer,

  2. Amit banerjee says:

    sum of two number using function pointer.

  1. July 2, 2014

    […] Also See: Demonstration on Pointer Operations Operations on Pointers […]

Leave a Reply

Your email address will not be published. Required fields are marked *