xczapien9114 xczapien9114
  • 28-08-2017
  • Computers and Technology
contestada

a. True
b. False: one purpose that constructor functions are often used for is to allocate memory that will be needed by the object.

Respuesta :

kaevras
kaevras kaevras
  • 28-08-2017
Yeah, definitely, a lot of the time. Sometimes, information must be passed to the constructor, information which couldn't of been known at compile-time.

In short terms, constructors are used for setting up, and this includes allocating memory to different variables and objects that belong to that instance of the class.

Destructors do quite the opposite, where they are used for deallocating memory and performing general clean-up, which can help to avoid memory leaks.
Answer Link

Otras preguntas

Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Mini-Project: Cents and the Central Limit Theorem 1. Collect a sample of at least 50 pennies by setting aside all the pennies you receive in change for severa
how were north american colonies all similar in the 1700s?
What were the major causes of WWII? Please include at least 4 answers.
What were the major causes of WWII? Please include at least 4 answers.
What are the functions of receptors in our body? Think of a situation where receptors do not work properly. What problems are likely to arise?