Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



C++ Interview Questions
Questions Answers Views Company eMail

How does free know the size of memory to be deleted

865

What's the value of the expression 5["abxdef"]?

1560

How to delete array of objects in C++? Proof by C++ code for proper deletion

864

How to stop class inheritance in C++ with condition that object creation should be allowed

739

What is Advantage and Use of THIS pointer in C++ – Scenarios?

759

C++ Public access specifier instead of Private – What is bad ?

893

Is there a difference between class and struct?

1022

How many times will this loop execute? Explain your answer.

883

How can a C function be called in a C++ program?

752

C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.

845

What is a built-in function?

1 1347

What is the difference between global int and static int declaration?

1067

Difference between const char* p and char const* p?

1 1642

Specify different types of decision control statements?

859

Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL

812


Un-Answered Questions { C++ }

What does ios :: app do in c++?

1037


What are the uses of c++ in the real world?

1039


What is pair in c++?

1069


Differentiate between the manipulator and setf( ) function?

1210


What is abstraction in oop with example?

1133


What is the difference between Stack and Queue in C++?

1074


What is heap sort in c++?

1074


Explain friend class?

1133


Can a varargs method be overloaded?

1108


Do you know what are static and dynamic type checking?

1065


C++ Public access specifier instead of Private – What is bad ?

893


What Is A Conversion Constructor C++ ?

1176


What is the purpose of ios::basefield in the following statement?

1266


What is the difference between a template and a macro?

1067


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

2132