if 4-5 year old brother is standing on d roof with me and
watching d moon, suddenly moon coverd by cloud then how
will i explain d hiding of moon to my brother.
When is the last time you coded in C/C++? What is the most
lines of original C/C++ code you have personally written in
one project? How confident are you in your ability to write
C or C++ without a reference?
Question In a class, there is a reference or pointer of an
object of
another class embedded, and the memory is either allocated
or assigned to the new object created for this class. In
the constructor, parameters are passed to initialize the
data members and the embedded object reference to get
inialized. What measures or design change should be advised
for proper destruction and avioding memory leaks, getting
pointers dangling for the embedded object memory
allocation? Please suggest.
Question Submitted By :: Sunil Kumar
I also faced this Question!! Rank Answer Posted By
Re: In a class, there is a reference or pointer of an
object of another class embedded, and the memory is either
allocated or assigned to the new object created for this
class. In the constructor, parameters are passed to
initialize the data members and the embedded object
reference to get inialized. What measures or design change
should be advised for proper destruction and avioding
memory leaks, getting pointers dangling for the embedded
object memory allocation? Please suggest.
Answer
# 1 use copy constructors
0 Shanthila
There is something to be taken care in destructor, in copy
constructor, suppose the memory is assigned to the embedded
member object pointer with the parameter passed value, but
if some other objects of different class also are pointing
to this memory, then if some one deletes the object then
this class member pointer object will become dangling, or
if the object is not deleted properly then there will be
memory leak. Please suggest the design change required to
handle or avoid this situation
28
how can u create a doubly linked list with out using
pointers?
9
Describe the My Computer and My Documents folders;
identify the elements that are present in every Window.
43
write a code for this. serial_number contained in the
header of the file will be read , if this serial number is
less than a previous serial number within a successfully
processed file, or is the same as another serial number
within a successfully processed file, or if the field
contains anything other than 7 digits, then the file must
error with the reason ‘Invalid SERIAL_NUMBER’.
i had specified the access specifier for abstarct class
member like (pure virtual function) as private.But it can
be accessed by the derived class.How the private member of
one class is accessed by other class.if any body face this
problem and found the solution plz reply to me.
19
How to execute business logic for only once ..?even though
user clicks submit button multiple times by mistake..?
(i disabled JavaScript)
39
sir plz send me a set of questions that been frequently
held in written examination during campus selection.
20
why we cant create array of refrences
6
how can we design a magic square in c++?or suggest me the
basic idea of it.