SlideShare a Scribd company logo
In C++ what are best practices for garbage collection?
In C++ what are best practices for garbage collection?
Solution
The garbage collection in cpp is automatic but if you want to release resources yourself like
closing files and release memory you can use :
- destructor in case of objects which are destroyed or released from memory after its scope ends
- delete operator to release other type of resources

More Related Content

More from pigsleypeyno82989

Greater than how many millimeters does the ST segment have to be to .pdf
Greater than how many millimeters does the ST segment have to be to .pdfGreater than how many millimeters does the ST segment have to be to .pdf
Greater than how many millimeters does the ST segment have to be to .pdf
pigsleypeyno82989
 
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdffar Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
pigsleypeyno82989
 
Fiber opticsSolutionSONET STS 12Synchronous Transport Sig.pdf
Fiber opticsSolutionSONET  STS 12Synchronous Transport Sig.pdfFiber opticsSolutionSONET  STS 12Synchronous Transport Sig.pdf
Fiber opticsSolutionSONET STS 12Synchronous Transport Sig.pdf
pigsleypeyno82989
 
Explain the following ASM code in detail, giving the reasons for the .pdf
Explain the following ASM code in detail, giving the reasons for the .pdfExplain the following ASM code in detail, giving the reasons for the .pdf
Explain the following ASM code in detail, giving the reasons for the .pdf
pigsleypeyno82989
 
Discuss the importance of top management commitment and the developm.pdf
Discuss the importance of top management commitment and the developm.pdfDiscuss the importance of top management commitment and the developm.pdf
Discuss the importance of top management commitment and the developm.pdf
pigsleypeyno82989
 
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdfDiscrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
pigsleypeyno82989
 
Describe the usage of technology by Fedex in all its sectorsSolu.pdf
Describe the usage of technology by Fedex in all its sectorsSolu.pdfDescribe the usage of technology by Fedex in all its sectorsSolu.pdf
Describe the usage of technology by Fedex in all its sectorsSolu.pdf
pigsleypeyno82989
 
Dawn Burke, director of employee relations, glanced at her online ca.pdf
Dawn Burke, director of employee relations, glanced at her online ca.pdfDawn Burke, director of employee relations, glanced at her online ca.pdf
Dawn Burke, director of employee relations, glanced at her online ca.pdf
pigsleypeyno82989
 
Consider the two mutually exclusive projects in the table below. Salv.pdf
Consider the two mutually exclusive projects in the table below. Salv.pdfConsider the two mutually exclusive projects in the table below. Salv.pdf
Consider the two mutually exclusive projects in the table below. Salv.pdf
pigsleypeyno82989
 
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdfChoose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
pigsleypeyno82989
 
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdfAn urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
pigsleypeyno82989
 
A study was conducted on high school students in 2008. The research .pdf
A study was conducted on high school students in 2008. The research .pdfA study was conducted on high school students in 2008. The research .pdf
A study was conducted on high school students in 2008. The research .pdf
pigsleypeyno82989
 
A RandstadHarris interactive survey reported that 25 of employees .pdf
A RandstadHarris interactive survey reported that 25 of employees .pdfA RandstadHarris interactive survey reported that 25 of employees .pdf
A RandstadHarris interactive survey reported that 25 of employees .pdf
pigsleypeyno82989
 
2.)a.) Are viruses that infect Archaea different from other bacter.pdf
2.)a.) Are viruses that infect Archaea different from other bacter.pdf2.)a.) Are viruses that infect Archaea different from other bacter.pdf
2.)a.) Are viruses that infect Archaea different from other bacter.pdf
pigsleypeyno82989
 
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
pigsleypeyno82989
 
Why would you use a switch replace a hub in a Local Area Network a..pdf
Why would you use a switch replace a hub in a Local Area Network  a..pdfWhy would you use a switch replace a hub in a Local Area Network  a..pdf
Why would you use a switch replace a hub in a Local Area Network a..pdf
pigsleypeyno82989
 
Why is the endodermis essential in the root but not in the stemIn.pdf
Why is the endodermis essential in the root but not in the stemIn.pdfWhy is the endodermis essential in the root but not in the stemIn.pdf
Why is the endodermis essential in the root but not in the stemIn.pdf
pigsleypeyno82989
 
What type of pollinators like long tubular flowersSolutionAns.pdf
What type of pollinators like long tubular flowersSolutionAns.pdfWhat type of pollinators like long tubular flowersSolutionAns.pdf
What type of pollinators like long tubular flowersSolutionAns.pdf
pigsleypeyno82989
 
When did satellite communication become viable, i.e. what timeframe (.pdf
When did satellite communication become viable, i.e. what timeframe (.pdfWhen did satellite communication become viable, i.e. what timeframe (.pdf
When did satellite communication become viable, i.e. what timeframe (.pdf
pigsleypeyno82989
 
What makes a solid perfect What are the possible faces of the Plato.pdf
What makes a solid perfect  What are the possible faces of the Plato.pdfWhat makes a solid perfect  What are the possible faces of the Plato.pdf
What makes a solid perfect What are the possible faces of the Plato.pdf
pigsleypeyno82989
 

More from pigsleypeyno82989 (20)

Greater than how many millimeters does the ST segment have to be to .pdf
Greater than how many millimeters does the ST segment have to be to .pdfGreater than how many millimeters does the ST segment have to be to .pdf
Greater than how many millimeters does the ST segment have to be to .pdf
 
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdffar Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
far Fie Edit View History Bookmarks Window Help roedopencampus blackb.pdf
 
Fiber opticsSolutionSONET STS 12Synchronous Transport Sig.pdf
Fiber opticsSolutionSONET  STS 12Synchronous Transport Sig.pdfFiber opticsSolutionSONET  STS 12Synchronous Transport Sig.pdf
Fiber opticsSolutionSONET STS 12Synchronous Transport Sig.pdf
 
Explain the following ASM code in detail, giving the reasons for the .pdf
Explain the following ASM code in detail, giving the reasons for the .pdfExplain the following ASM code in detail, giving the reasons for the .pdf
Explain the following ASM code in detail, giving the reasons for the .pdf
 
Discuss the importance of top management commitment and the developm.pdf
Discuss the importance of top management commitment and the developm.pdfDiscuss the importance of top management commitment and the developm.pdf
Discuss the importance of top management commitment and the developm.pdf
 
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdfDiscrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
Discrete Math Problem - Chinese Remainder TheoremWe recently disc.pdf
 
Describe the usage of technology by Fedex in all its sectorsSolu.pdf
Describe the usage of technology by Fedex in all its sectorsSolu.pdfDescribe the usage of technology by Fedex in all its sectorsSolu.pdf
Describe the usage of technology by Fedex in all its sectorsSolu.pdf
 
Dawn Burke, director of employee relations, glanced at her online ca.pdf
Dawn Burke, director of employee relations, glanced at her online ca.pdfDawn Burke, director of employee relations, glanced at her online ca.pdf
Dawn Burke, director of employee relations, glanced at her online ca.pdf
 
Consider the two mutually exclusive projects in the table below. Salv.pdf
Consider the two mutually exclusive projects in the table below. Salv.pdfConsider the two mutually exclusive projects in the table below. Salv.pdf
Consider the two mutually exclusive projects in the table below. Salv.pdf
 
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdfChoose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
Choose 5 and Define Malpighian tubules, hemolymph, exoskeleton, ampu.pdf
 
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdfAn urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
An urn contains 4 red balls and 6 green balls. Two balls are drawn o.pdf
 
A study was conducted on high school students in 2008. The research .pdf
A study was conducted on high school students in 2008. The research .pdfA study was conducted on high school students in 2008. The research .pdf
A study was conducted on high school students in 2008. The research .pdf
 
A RandstadHarris interactive survey reported that 25 of employees .pdf
A RandstadHarris interactive survey reported that 25 of employees .pdfA RandstadHarris interactive survey reported that 25 of employees .pdf
A RandstadHarris interactive survey reported that 25 of employees .pdf
 
2.)a.) Are viruses that infect Archaea different from other bacter.pdf
2.)a.) Are viruses that infect Archaea different from other bacter.pdf2.)a.) Are viruses that infect Archaea different from other bacter.pdf
2.)a.) Are viruses that infect Archaea different from other bacter.pdf
 
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
1.What are STR advantages over RFLP and PMDQa 2.list 3 examples of .pdf
 
Why would you use a switch replace a hub in a Local Area Network a..pdf
Why would you use a switch replace a hub in a Local Area Network  a..pdfWhy would you use a switch replace a hub in a Local Area Network  a..pdf
Why would you use a switch replace a hub in a Local Area Network a..pdf
 
Why is the endodermis essential in the root but not in the stemIn.pdf
Why is the endodermis essential in the root but not in the stemIn.pdfWhy is the endodermis essential in the root but not in the stemIn.pdf
Why is the endodermis essential in the root but not in the stemIn.pdf
 
What type of pollinators like long tubular flowersSolutionAns.pdf
What type of pollinators like long tubular flowersSolutionAns.pdfWhat type of pollinators like long tubular flowersSolutionAns.pdf
What type of pollinators like long tubular flowersSolutionAns.pdf
 
When did satellite communication become viable, i.e. what timeframe (.pdf
When did satellite communication become viable, i.e. what timeframe (.pdfWhen did satellite communication become viable, i.e. what timeframe (.pdf
When did satellite communication become viable, i.e. what timeframe (.pdf
 
What makes a solid perfect What are the possible faces of the Plato.pdf
What makes a solid perfect  What are the possible faces of the Plato.pdfWhat makes a solid perfect  What are the possible faces of the Plato.pdf
What makes a solid perfect What are the possible faces of the Plato.pdf
 

Recently uploaded

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 

In C++ what are best practices for garbage collectionIn C++ wha.pdf

  • 1. In C++ what are best practices for garbage collection? In C++ what are best practices for garbage collection? Solution The garbage collection in cpp is automatic but if you want to release resources yourself like closing files and release memory you can use : - destructor in case of objects which are destroyed or released from memory after its scope ends - delete operator to release other type of resources