What is Pointers- Definition and Declaration
Pointers
A pointer is a variable that holds a memory address. This address is the location of another object (typically another variable) in memory. For example, if one variable contains the address of another variable, the first variable is said to point to the second.
The correct understanding and use of pointers is critical to successful C/C++ programming. There are three reasons for this: First, pointers provide the means by which functions can modify their calling arguments. Second, pointers support dynamic allocation. Third, pointers can improve the efficiency of certain routines.
Pointers are one of the strongest but also one of the most dangerous features in C/C++. For example, uninitialized pointers (or pointers containing invalid values) can cause your system to crash. Perhaps worse, it is easy to use pointers incorrectly, causing bugs that are very difficult to find. Because of both their importance and their potential for abuse.
• Pointer Variable
• The Pointer Operators
• Pointer Expressions
• Pointer Assignments
• Pointer Arithmetic
• Pointer Comparisons
• Pointers and Arrays
• Arrays of Pointers
• Multiple Indirection
• Initializing Pointers
• Pointers to Functions
• C’s Dynamic Allocation Functions
• Problems with Pointers
Popularity: 1% [?]