Introduction of Pointers


What is a Pointer?

A pointer is a derived data type found in C that is made up of one of the basic data types available in C, the memory addresses in the pointers remain as their values. Since these memory addresses are locations in computer memory where program instructions and data stores are located, pointers can be used to access and manage data stored in memory.

Pointers are undoubtedly one of the most distinct and exciting features of the C language. It has added power and flexibility to the language. Although they appear a little confusing and difficult to understand for a beginner, they are a powerful tool and handy to use once they are mastered.

Pointers are used frequently in C, as they offer a number of benefits to the programmers. They include :

  1. More efficient to manage arrays of pointers and data tables.
  2. Pointers can be used to return multiple values from a function via function arguments.
  3. Pointers permit references to functions and thereby facilitating the passing of functions as arguments to other functions.
  4. The use of pointer arrays to character strings results in the saving of data storage space in memory.
  5. Pointer C lets you support dynamic memory management.
  6. Pointers provide an effective tool for manipulating dynamic data structures such as structures, linked lists, rows, stacks, and trees.
  7. Pointers reduce the length and complexity of programs.
  8. These increase the speed of execution and thus reduce the application time of the program.