Advantages of using pointer
- Pointers are more efficient in handling arrays and data tables
- Pointers can be used to return multiple values from a function
via function argument.
- Pointers permit reference to functions and thereby facilitating
passing of functions as arguments to other function.
- The use of pointer arrays to character strings results in saving
of data storage space in memory.
- The main advantage of pointer is dynamic memory management.
- Pointers provide an efficient tool for manipulating dynamic data
structure such as linked list, queue, stack, trees.
- Pointer reduce length and complexity of programs.
- They increase the execution speed and thus reduce the program
execution time.
Important
points to be remember while using pointer
- Pointer must be initialized before it is used.
- Pointer can be initialized while declaring.
- Integers should point to elements of appropriate type.
- when pointer is incremented , it is incremented as per the size
of variable to which it points.
- Two pointer are never added.
- Pointer can be effectively used with array,
function,string,structure etc.
- Integer number can be added or subtracted from pointer.
- & operator is used with pointer to get the address of variable which stores value
Posted By :Ruchita Pandya
No comments:
Post a Comment