Constructor overloading, just like any function's overloading, is where more than one configuration of parameters exists for the function. Based on the number and type of the parameters, different versions of the function can be resolved by the linker.
This is typically used in the constructor as the default constructor (no parameters), the copy constructor (one reference parameter of the same type as the class), and the conversion constructor (any other combination of parameters).
True - A C++ constructor cannot return a value.
A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.
An implicit constructor call will always call the default constructor, whereas explicit constructor calls allow to chose the best constructor and passing of arguments into the constructor.
C: there are no methods in C. C++: no.
Yes. Any base class method that is declared virtual can be overridden by a derived class. Overriding a method that is not declared virtual can still be called, but will not be called polymorphically. That is, if you call the base class method, the base class method will execute, not the override. To call a non-virtual override you must call it explicitly.
Yes.
True - A C++ constructor cannot return a value.
A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.
An implicit constructor call will always call the default constructor, whereas explicit constructor calls allow to chose the best constructor and passing of arguments into the constructor.
C: there are no methods in C. C++: no.
No. Constructors initialise objects and, by definition, must be able to modify the member variables. Uninitialised members are a disaster waiting to happen even without a constructor declared const! Thankfully, the compiler won't permit a const constructor.
Yes. Any base class method that is declared virtual can be overridden by a derived class. Overriding a method that is not declared virtual can still be called, but will not be called polymorphically. That is, if you call the base class method, the base class method will execute, not the override. To call a non-virtual override you must call it explicitly.
one reason to use new and delete operator overloading in c++ is when you are using your own memory manager code. when the user of your code calls the new keywork, your memory manager code can allocate memory.
Class initialisation is normally handled by the class constructor(s). Every constructor has an optional initialisation section between the declaration and the body of the constructor. This is generally used to call specific base class constructors, but can be used to initialise any member variables via their own constructors. Member variables may alternatively be initialised in the body of the constructor, but this is really only necessary when member pointers need to be allocated new memory. For those classes that have many members and many constructors, the initialisation may be handled by a private member method called by each constructor in order to simplify maintenance during development. However, when the class is finalised, the private member method will generally be replaced with formal initialisation sections in each constructor.
No. Operator and/or function overloading is only a C++ thing.
It cannot. Inheritance is a compile-time operation. Constructors are invoked at runtime at the point of instantiation.
There is no such thing as a constructor function in C++ (constructors have no return value, not even void, and cannot be called like regular functions). Constructors are invoked rather than called directly, either by declaring a static variable of the class type, or via the C++ new operator.