answersLogoWhite

0

What are the advantage and disadvantage using pointer?

Updated: 8/17/2019
User Avatar

Varunsathish

Lvl 1
9y ago

Best Answer

The advantage of a pointer is that it is the only way to keep track of memory allocated on the heap (free store). The disadvantage is that the programmer must remember to release an allocation before all references to that memory fall from scope, otherwise a resource leak is incurred. To make this easier, resource handles can be used instead of pointers. A resource handle behaves exactly like a pointer but when the handle falls from scope, the resource is automatically released.

Pointers are also useful in other areas besides memory management, they can also be used to refer to memory that is already allocated, allowing a convenient and efficient method of iterating through a sequence of consecutive memory addresses.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the advantage and disadvantage using pointer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the advantage and disadvantage of using SEPIC converter for PV apllication?

What are the advantage and disadvantage of SEPIC converter


What are Advantage disadvantage of electronic filing system?

CAn get hacked mate


The advantage and disadvantage of a barometer?

advantage of using a barometer is that we can measure air pressure .a disadvantage is that there is barely any wind.


What are the advantage and disadvantage of the transportation?

One advantage of using transportation is that is quick. One disadvantage of using transportation is that it is expensive.


What are the advantage and disadvantage of using a heavy bat?

Advantage is that you can hit a ball further while the disadvantage is that it is harder to control or change the swing


What is a disadvantage to using community transportation?

the disadvantage of using community service is that you have to pay and you dont have the advantage to going where ever you want


What is the Advantage and Disadvantage of using acetone?

aba ^^ malay kuh


What are advantage and disadvantage of using multimedia mobile in college?

an advantage is that its fun to do but the disadvantage is that your either going to have it taken away if you use it in class or ..... well thats it


What are the advantage and disadvantage of pyconometer?

An advantage of using a pycnometer is that the instrument does not have to be in direct contact with the fluid it is measuring.Ê A disadvantage could be that it can be easily broken as it is made out of glass.


What are the advantage disadvantage of using cellphone inside the?

The advantage of using a cellphone is that it is portable and affordable. It therefore makes communication easier and faster. The disadvantage is that it may lack privacy and may be very costly.


What is the advantage and disadvantage of using thermostat in an iron?

The advantage of using the thermostat is so you don't burn or scorch your clothes when you are using it. An iron can become very hot quickly.


What are the advantage and disadvantage of fidelio?

What are the advantage and disadvantage of fidelio?"