pointers
Gapfill exercise
Enter your answers in the gaps. When you have entered all the answers, click on the "Check" button.
What is Double Pointer (Pointer to Pointer)?
As we know that, a
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is used to store the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
of a variable in C.
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
reduces the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
time of a variable. However, In C, we can also define a pointer to
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
the address of another
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
. Such
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is known as a
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
pointer (pointer to pointer). The first pointer is used to
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
the address of a
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
whereas the second
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is used to store the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
of the first pointer. Let's understand it by the diagram given below.
Define Pointer Arithmetic in C?
We can perform arithmetic
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
on the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
like addition, subtraction, etc. However, as we know that
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
contains the address, the result of an
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
operation performed on the pointer will also be a pointer if the other operand is of type integer. In pointer-from-
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
, the result will be an
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
value. Following
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
operations are possible on the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
in C language:
Increment, Decrement, Addition, Subtraction, Comparison.
Define Dangling pointer ?
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
pointer occurs at the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
of the object destruction when the object is
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
or de-allocated from memory without modifying the value of the pointer. In this case, the pointer is pointing to the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
, which is de-
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
. The dangling pointer can point to the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
, which contains either the program code or the code of the operating
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
. If we assign the value to this
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
, then it overwrites the value of the program code or
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
system instructions; in such cases, the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
will show the undesirable result or may even crash. If the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is re-allocated to some other process, then we dereference the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
pointer will cause the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
faults.
How can you Avoid Dangling pointer error?
The
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
pointer errors can be
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
by initializing the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
to the NULL value. If we assign the NULL value to the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
, then the pointer will
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
point to the de-allocated
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
. Assigning
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
value to the pointer means that the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is not pointing to any memory location.
What is a Constant Pointers?
A
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
pointer in C cannot change the address of the
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
to which it is pointing, i.e., the address will remain
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
. Therefore, we can say that if a constant
access
address
allocated
arithmetic
avoided
constant
Dangling
deleted
double
integer
memory
not
NULL
operating
operations
pointer
pointers
program
segmentation
store
subtraction
system
time
variable
is pointing to some variable, then it cannot point to any other variable
Check
OK