Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
what is inheritanceclass the vehicle which is used to execute object-oriented concepts in c has given a new dimension to this idea of reusability
reusability reusability means reusing code written earlier may be from some earlier project or from the library reusing old code not only saves
reference odditiesa reference variable can demote to any integer variable be it in an array or a member variable from structure or class reference
returning references from functionsjust as in passing the parameters by reference returning a reference also doesnt return back a copy of the
call by referencepassing variablesparameters to a function in c can be done in two ways - pass by value also called as call by value and pass by
precautions with function overloadingfunction overloading is a boon to designers since dissimilar names for same functions need not be thought of
function overloadingfunction overloading is a form of polymorphism function overloading facilitates explaining one function having many forms in
change the matrix program program 3 slightly overload operator to compare two matrices to be added or subtracted ie whether the column of first and
conversion between objects of different classesas the compiler does not know anything about the user-defined type the conversion instructions are to
conversion from basic to user-defined variableconsider the following exampleclass distance
conversion functionsconversion functions are member functions used for the following purposes1 conversion of object to basic data type2 conversion of
rules for overloading an operatorthis summarizes the most significant points you need to know in order to do operator function overloading the only
implementing operator functionsthe general format of the operator function isreturntype operator op argument list where op is the symbol for the
operator overloading fundamentalsthe c language uses the concept of operator overloadingdiscreetly the asterisk is used as multiplication operator
explain operator overloadingit is one type of polymorphism an significant feature of object-oriented programming polymorphism means one thing having
write a program to add co-ordinates of the plane the class having x and y co-ordinates create three objectsuse a constructor to pass one pair of
a constructive exampleconsider an example to model a user-defined data type for strings the object simulates a character array string using a
the default constructor and destructorif you fail to write a constructor and destructor function the compiler automatically supplies them for you
syntax rules for writing a destructor function its name is the similar as that of the class to which it belongs except that the first character of
destructorsa destructor function gets implemented whenever an instance of the class to which it belongs goes out of existencethe primary usage of a
using the constructorthere are basically three ways of creating and initializing the object the first way to call the constructor is explicitly as
syntax rules for writing constructor functions its name must be similar as that of the class to which it belongs it is declared with no return type
constructorsby definition a constructor function of some class is a member function that automatically gets implemented whenever an instance of the
explain a class to model a banking systemthe function members should allow initializing the data members a query to facilitate for account and a
dereferencing the pointer thissometimes a member function requires to make a copy of the invoking instance so that it can change the copy without