![]() Related Questions A scope resolution operator (::), can be used to define the member functions of a class outside the class. Latest Answer : Scope resolution:As the name itself indicates,it resolves global scope to local scopeEx:int a=10;int main(){a=20;cout The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, Latest Answer : free() - releases the memory of the pointer passed as parameter, to the OS/application consumption. Using the pointer after free() will result in undefinded resultsrealloc() - used to resize the memory held by the pointer to the number of bytes specificed. ... Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or a reference to the base type. RTTI is the official way in standard C++ to discover the type Latest Answer : We can only assign a derived object to a base object pointer and a base class member to a derived class member pointer. ... Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching Latest Answer : Virtual constructor is not build-in C++ feature but it doesn't mean its not used by devs in code and in conversations. There are many other things that doesn't exist in particular language yet, people find ways around to solve it (SingleTon, Virtual Constructor, ... Latest Answer : Memory leak is - dynamically allocating memory and forgeting to free it. In C++, using a new operator to allocate a chunk of memory, and forgetting to delete it. There are several reasons this could occur. Some of them are,1. Allocate a chunk of memory ... Read Answers (4) | Asked by : gopala krishna Latest Answer : Its just by using new and delete operators which will allocate at runtime as in C++In C,v hav to use malloc,free operators . ... How is static variable stored in the memory?( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory). Read Answers (7) | Asked by : prabhakar pillai Latest Answer : Copy constructor is 1. a constructor function with the same name as the class 2. used to make deep copy of objects. There are 3 important places where a copy constructor is called. 1. When an object is created from another object of the same type 2. When ... Latest Answer : To avoid memmory leaks you should use smart pointers. ...
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||