What is a Pointer?
A pointer is a variable that stores the memory address of another variable.
- Normal variable → stores value
- Pointer variable → stores the address of a value.
Declaring a Pointer
Syntax: data_type *pointer_name;
Example: int *p; // p is a pointer to an integer
Assigning Address to a Pointer
Use & (address-of operator) to store the address of a variable.
Example
0 Comments