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 is used to store the of a variable in C. reduces the time of a variable. However, In C, we can also define a pointer to the address of another . Such is known as a pointer (pointer to pointer). The first pointer is used to the address of a whereas the second is used to store the of the first pointer. Let's understand it by the diagram given below.

Define Pointer Arithmetic in C?
We can perform arithmetic on the like addition, subtraction, etc. However, as we know that contains the address, the result of an operation performed on the pointer will also be a pointer if the other operand is of type integer. In pointer-from- , the result will be an value. Following operations are possible on the in C language:
Increment, Decrement, Addition, Subtraction, Comparison.

Define Dangling pointer ?
pointer occurs at the of the object destruction when the object is or de-allocated from memory without modifying the value of the pointer. In this case, the pointer is pointing to the , which is de-. The dangling pointer can point to the , which contains either the program code or the code of the operating . If we assign the value to this , then it overwrites the value of the program code or system instructions; in such cases, the will show the undesirable result or may even crash. If the is re-allocated to some other process, then we dereference the pointer will cause the faults.

How can you Avoid Dangling pointer error?
The pointer errors can be by initializing the to the NULL value. If we assign the NULL value to the , then the pointer will point to the de-allocated . Assigning value to the pointer means that the is not pointing to any memory location.

What is a Constant Pointers?
A pointer in C cannot change the address of the to which it is pointing, i.e., the address will remain . Therefore, we can say that if a constant is pointing to some variable, then it cannot point to any other variable