(This question has been asked in GU Uni Dec 2018 for 7 Mark) A constructor is a member function of a class, whose name is the same as the class name. A constructor is automatically called when an object of
Write a short note on Function Overloading in C++
(This question has been asked in GU Uni Dec 2018 for 7 Mark) In C++, two functions can have the same name if the number and/or type of arguments passed is different. These functions having the same name but different
Write Short notes on Default Arguments in C++.
(This question has been asked in GU Uni Dec 2018 for 7 Mark) A default argument is a value provided in a function declaration that is automatically assigned by the compiler if the caller of the function doesn’t provide a
How to define the Function outside the class body? Explain with an example.
(This question has been asked in GU Uni Dec 2018 for 7 Mark) SCOPE RESOLUTION OPERATOR ( :: ) With the help of the Scope Resolution Operator, we can define the public member function outside of the class body. To
What is an Arrow Operator? Explain with an example.
(This question has been asked in GU Uni Dec 2018 for 7 Mark) The -> (arrow) operator is used to access structure or C++ class members using a pointer. The dot and arrow operator are both used in C++ to
Type Conversion in CPP – Conversion from one Class types to another class type
Type Conversion in CPP – Conversion from Class types to basic type
We need to use special function called type-conversion function. Type conversion function uses operator keyword and syntax is as mentioned below. Operator type() {} Example