![]() Related Questions Ø Public, protected and private are three access specifiers in C++. Ø Public data members and member functions are accessible Latest Answer : These are three important access specifiers.1. Private - Members are accessible only to member functions and friend function.
2. Protected - Members are accessible to member functions of the class and classes which are derived from this class.
3. Public ... As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be Latest Answer : Friend function is used in OOP languages which allows a private or protected function to be accessed by a member outside a class.
Any function outside a Class can be given access to work with members inside a class by simply writing a keyword
friend ... 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. ... A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to Latest Answer : Pure virtual function is the virtual functions which member functions does not have any definitions(implementation),just it equates(=) to 0. With Pure virtual function, the base class becomes "Abstract class". The abstract class does not instantiate/ ... 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 : A constructor of a class is mainly responsibly for turning the raw memory allotted to an object into a usable object. DEFAULT CONSTRUCTOR:The default constructor is a constructor that takes no argument. Part::Part()String() and String(const char* str) ... Latest Answer : Inspite of repeated requests by some (few) sensible people to everybody to read the question properly before responding, nobody listens.For doreen, the question does not ask you to explain deep copy and shallow copy mechanism neither does is asks how ... No Latest Answer : yes in c++ a class can have a default constructor.a default constructor is a constructor which doesn't pass any arguements to it. ... Read Answers (6) | Asked by : Nisar.E 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
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||