Professional Documents
Culture Documents
Ja Veria
Ja Veria
What is Pointer?
o Pointer is variable that hold address of another variable of same
data type, present in memory.
o It is a derived data-type which constructed with the primitive
data-type.
o The size of pointer variable is 2-Bytes for any data-type, The
pointer variable allow us to occupies the memory runtime.
o Pointer helps us to easily implement data structure
programming.
o While working with pointer we need two uniary operators.
i.e
1. & -> Address of operator
2. * -> Value at address operator
The pointer variable declared has syntax.
Syntax: <data-type>*<Variable name> an example int *p;
TYPES OF POINTERS
SYNTAX
Void * var-name;
NULL Pointer
o A pointer variable that is initialized
with the NULL value at the time of
pointer declaration is called NULL
pointer.
o The NULL pointer does not point to any
memory location.
SYNTAX
Data-type * var-name= <\0>;
Wild Pointer
o A pointer variable that is not initialized
with any address is called wild pointer.
o Also known as bad pointer because it
holds the address of random memory
location.
SYNTAX
Data-type * var-name;
Pointer to Pointer
o A pointer variable which holds the
address of another pointer variable is
called pointer to pointer.
o We can implement the pointer to
pointer operation upto 12 stages.
SYNTAX
** var-name;
Function Pointer
o A pointer variable that holds the
address of function is known as the
function pointer.
SYNTAX
Return-type (*var-name) ( );
Dangling Pointer
o A pointer variable that holds the
address of an inactive area location
then the pointer is called the dangling
pointer.
SYNTAX
*var-name;