Pointers in C
📘 C
👁 37 views
📅 Dec 22, 2025
⏱ Estimated reading time: 1 min
A pointer is a variable that stores the address of another variable.
Declaration of Pointer
Example:
Initialization of Pointer
Accessing Value Using Pointer
-
&→ Address of operator -
*→ Dereference operator
Example Program
Pointer Arithmetic
-
p + 1moves pointer to next memory location -
Increments depend on data type size
Types of Pointers
-
Null Pointer
-
Void Pointer
-
Wild Pointer
-
Dangling Pointer
Pointer and Array Relationship
-
Array name acts as a pointer to first element
Passing Pointer to Function
Used to modify original value (Call by Reference).
Advantages of Pointers
-
Efficient memory usage
-
Supports dynamic memory allocation
-
Enables call by reference
-
Useful in arrays and strings
Precautions
-
Initialize pointers before use
-
Avoid accessing invalid memory
-
Use pointers carefully to prevent errors
Summary
-
Pointers store memory addresses
-
*and&are key pointer operators -
Closely related to arrays and functions
-
Powerful but must be used carefully
🔒 Some advanced sections are available for Registered Members
Register Now
Register Now
Share this Post
← Back to Tutorials