2. MEMORY
ADDRESS
A memory space is allocated for each variable that
holds the value of that variable, this memory space
has an address.
For example we live in a house and each house has
an address, which helps other people to find a
house.
The same way the value of the variable is stored in a
memory address, which helps the C program to find
that value when it is needed.
3. WHAT IS A C
POINTERS?
Special variables that is used
to store addresses rather
than the values.
It is a variable whose value is
the address of another
variable.
It is a derived data type that
stores the memory address
of a variable.
4. SYNTAX
Data type *pointer variable name;
• Data type
• Type of variable that the pointer points to or data type whose address is stored in
pointer_name
• Pointer variable name
• A valid variable name following rules of variable name regulation.
• A pointer variable name
Where:
5. POINTER OPERATOR
Operator Operator Name Purpose
* Value at Address
Operator
GivesValue stored at Particular
address
& Address Operator Gives Address ofVariable
7. IMPORTANT POINTER CONCEPTS
Pointer Arithmetic
Basic Arithmetic
operators (++,--,+,-)
Array of Pointers
Defining an array to
hold number of
pointers.
Pointer to pointer
Allows to have pointer
to a pointer
Passing pointers to
functions in C
Passing an argument
by reference or by
address. It enables to
passed the argument
to be changed in the
calling function.
Return pointer from
functions in C
Allows function to
return to a pointer