search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
0 votes
43 views
If I allocate the memory using new operator to member in constructor I.e dynamic constructor than should I have to write delete in destructor
in Object Oriented Programming 43 views

1 Answer

0 votes
Whenever you allocate memory dynamically for an object in C++, You must deallocate that memory manually using a Destructor

Related questions

0 votes
0 answers
1
86 views
if we call the constructor than did the constructor will implicitly calls the new operator to allocate memory and it is from the heap area?
asked Mar 31, 2018 in Object Oriented Programming kd..... 86 views
1 vote
1 answer
2
247 views
Which of the statements below are true ? default constructor does not accept a parameter constructor can accept a reference to its own class as parameter copy constructor is known as copy initialization destructor accepts any type of value as parameter i and iii i, ii and iii ii and iii All of the above
asked Jul 9, 2016 in Programming sh!va 247 views
0 votes
0 answers
3
136 views
70. Assume that we have constructor functions for both base class and derived class. Now consider the declaration in main( ). Base * P = New Derived; in what sequence will the constructor be called ? (A) Derived class constructor followed by Base class ... followed by derived class constructor. (C) Base class constructor will not be called. (D) Derived class constructor will not be called
asked Jun 1, 2016 in Programming Sanjay Sharma 136 views
0 votes
1 answer
4
61 views
If the objects focus on the problem domain, then we are concerned with Object Oriented Analysis Object Oriented Design Object Oriented Analysis and Design None of the above
asked Apr 1 in Object Oriented Programming Lakshman Patel RJIT 61 views
...