Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
for object malloc allocates memory in heap however doesnt invoke objects constructor to initialize the object new allocates memory amp also invokes
when you allocate memory with new you ought to free the memory via delete while you allocate memory along new then use delete with no the brackets
both malloc amp new functions are utilized for dynamic memory allocations amp the basic difference is malloc need a special typecasting while it
what is the difference among mallocfree and newdeletea mallocfree do not know about destructors and constructors new amp delete create and destroy
should one design a classes from the outside interfaces first or inside data firsta from the outsidea superior interface provides a simplified view
why shouldnt matrix classs interface look like an array-of-arraya some people build a matrix class that has an operator that returns a reference to
employ operator instead of operatorwhile you have multiple subscripts the cleanest way to do it is along with operator instead of with operator the
what happens while a derived-class object is developed amp destroyeda space is allocated on the heap or the stack for the full object ie adequate
new data members new member functions new constructors and destructor new
it is a class defined in the scope of a function any function whether a member functions or a free function for instance example local classint
it is a class enclosed in the scope of another class for illustration example nested classclass outerclassclass nestedclass nested classes are
normal 0 false false false en-us x-none x-none
in order to override a method a subclass of the class which originally declared the method have to declare a method along with the same name return
a container class is a class which is used to hold objects in external storage and memory a container class work as a generic holder a container
what are all of the implicit member functions of the class or what are all of the functions that compiler implements for us if we dont describe
default assignment operator mange assigning one object to another object of the same class it is member to member copy as shallow
the code contains two built-in pitfalls first one if it executes in a member function for an static extern or automatic object the program will
it is a pointer accessible only in the member functions of a struct class or union type it points to the object for which the member function is
a it is containing and hiding information regarding an object like internal data structures and code it isolates the internal complication of an
how do you know that your class requires a virtual destructora if at least your class has one virtual function you must make a destructor for this
described the differences among a c struct amp c classa the default member amp base class access specifies are distinct it is one of the commonly
define a classa it is an expanded concept of a data structure rather than holding only data it can hold data and functions
define polymorphisma polymorphism let a client to treat distinct objects in the similar way even if they were developed from distinct classes and
describe problem with runtime type identificationa the run time kind identification comes at cost of performance penalty compiler maintains