Showing posts with label Advantages of using pointer. Show all posts
Showing posts with label Advantages of using pointer. Show all posts

Friday, 30 March 2012

Advantages of using pointer


Advantages of using pointer

  1. Pointers are more efficient in handling arrays and data tables
  2. Pointers can be used to return multiple values from a function via function argument.
  3. Pointers permit reference to functions and thereby facilitating passing of functions as arguments to other function.
  4. The use of pointer arrays to character strings results in saving of data storage space in memory.
  5. The main advantage of pointer is dynamic memory management.
  6. Pointers provide an efficient tool for manipulating dynamic data structure such as linked list, queue, stack, trees.
  7. Pointer reduce length and complexity of programs.
  8. They increase the execution speed and thus reduce the program execution time.

Important points to be remember while using pointer

  1. Pointer must be initialized before it is used.
  2. Pointer can be initialized while declaring.
  3. Integers should point to elements of appropriate type.
  4. when pointer is incremented , it is incremented as per the size of variable to which it points.
  5. Two pointer are never added.
  6. Pointer can be effectively used with array, function,string,structure etc.
  7. Integer number can be added or subtracted from pointer.
  8. & operator is used with pointer to get the address  of variable which stores value
Posted By :Ruchita Pandya