sir plz send me a set of questions that been frequently held in written examination during campus selection.
2063Question 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
2141Post New TCS OOPS Interview Questions
how to remove duplicates using proc sql?
What is branching logic control in VB.NET?
7. What are the different types of conventional and non conventional machining processes
What are your positive qualities?
A PLL maintains lock by comparing A The phase of two signals B The frequency of two signals C The amplitude of two signals D None of these
What is the minimum IR value of HT/ LT cable? Pls post separetely!!!!!
What are the cases why parameterization is necessary when load testing the Web server and the database server?
What is new in html 5?
What are the classifications of heating element?
How do you set goals for your team? And how do you track these goals?
What are internal tables check table, value table, and transparent table?
Why javac is not working in cmd?
What is a data error cyclic redundancy check?
Explain QlikView IntervalMatch() and Match() functions?
what are the protecyion of transformer & generators