Computer Science, asked by Apandey9768, 10 months ago

When deallocating a memory location pointed to by a pointer if the pointer variable is not modified?

Answers

Answered by alafiyasurkasl
0

Answer:

If the pointer variable is not changed after deallocating a memory location referenced to by a pointer, it points to the same deallocated memory address.

Explanation:

  • To deallocate a memory region pointed to by a pointer, you must first load the memory address to which the pointer has been assigned.
  • Deallocation is the process of releasing memory blocks that are no longer in use so that other applications can make the most of them.
  • Malloc is the most fundamental memory allocation function (). (void *) malloc(size t numbytes); is the function prototype.
  • It takes a single input, which is the number of bytes you wish to allocate (size t is usually the same as unsigned int), returns a reference to the new memory region.

#SPJ3

Answered by barmansuraj489
0

Concept introduction:

Simply explained, a pointer is a variable that stores the position of a location in the computer's memory. This is where the term "pointer" comes from. A pointer variable stores the address of a particular piece of computer memory; in other words, a pointer points to a specific memory location.

Explanation:

We have to answer the question.

A question has been given to us.

If the pointer variable is not changed after deallocating a memory location referenced to by a pointer, it points to the same deallocated memory address.

You must first load the memory location to which the pointer has been assigned before you may deallocate a memory region referred to by a pointer.

Deallocation is the process of freeing up memory blocks that are no longer in use so that other programmes can benefit from them.

Final answer:

Hence, the final answer of the question is->

The pointer variable points to the same deallocated memory address if it is not altered after deallocating a memory location referenced by a pointer.

#SPJ2

Similar questions