If one won''t explicitly call the destructor of a local then , C/C++ Programming

Assignment Help:

if one won't explicitly call the destructor of a local; then how does he handle the above situation?


Related Discussions:- If one won''t explicitly call the destructor of a local then

Read numbers form user and place them in array, Read numbers form user and ...

Read numbers form user and place them in array: Program is to read a group numbers of numbers form user and place them in array type of float and sort them void sort(floa

I need whatsapp software in my website, I need whatsapp software in my webs...

I need whatsapp software in my website Project Description: i need whatsapp software in my website same this whatsapp if anyone can make to me this in my website Skills

First line starts with T, Input Format: First line starts with T, which is...

Input Format: First line starts with T, which is the number of test cases. Each test case contains a string (S). Output Format: For each test case print the minimum number of ch

Structured design of programs, Within software engineering, software is ver...

Within software engineering, software is very rarely written by a single software engineer. Usually a team of engineers write a program; therefore a formal structural design approa

C, Write a program to find the area under the curve y = f(x) between x = a ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Some of the basic rules of cpp program, Ba s i c r u l e s o f C...

Ba s i c r u l e s o f C + + p r o g r a m : ·     I t m u s t h a v e o n l y o n e m a i n f u n c ti o n ·

Largest clique, find largest clique present in graph

find largest clique present in graph

Decoding , http://www.expertsmind.com/questions/decodethecode-30110560.aspx...

http://www.expertsmind.com/questions/decodethecode-30110560.aspx

3/15/2013 5:27:11 AM

if one won''t explicitly call the destructor of a local; then how does he handle the above situation?

A: Just wrap the extent of the lifetime of the local in an artificial block {...}:

void someCode()

{

{

 

File f;

...insert code which should execute while f is still open...

} f''s destructor will automatically be called here.

...insert code here which should execute after f is closed...}

 

3/15/2013 5:33:02 AM

if one won''t explicitly call the destructor of a local; then how does he handle the above situation?

A: Just wrap the extent of the lifetime of the local in an artificial block {...}:

void someCode()

{

{

 

File f;

...insert code which should execute while f is still open...

} f''s destructor will automatically be called here.

...insert code here which should execute after f is closed...}

 

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd