76
Pointer
Pointer is used to points the address of the value stored anywhere in the computer memory. To obtain the value stored at the location is known as dereferencing the pointer. Pointer improves the performance for repetitive process such as:
- Traversing String
- Lookup Tables
- Control Tables
- Tree Structures
Pointer Details
- Pointer arithmetic: There are four arithmetic operators that can be used in pointers: ++, –, +, –
- Array of pointers: You can define arrays to hold a number of pointers.
- Pointer to pointer: C allows you to have pointer on a pointer and so on.
- Passing pointers to functions in C: Passing an argument by reference or by address enable the passed argument to be changed in the calling function by the called function.
- Return pointer from functions in C: C allows a function to return a pointer to the local variable, static variable and dynamically allocated memory as well.
Program
Pointer
Output
Program
Pointer to Pointer
Pointer to Pointer
Next TopicDS Structure