Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
a it let you to provide an intuitive interface to users of your class as well as makes it possible for templates to equally work well with classes
can you overload a function depend only on whether a parameter is a value or a referencea no passing by value and reference looks identical to the
how are postfix and prefix versions of operator differentiateda the postfix version of operator contain a dummy parameter of type int the prefix
a along with the c language you can overload operators and functions overloading is the practice of supplying more than one definition for a provided
q name the operators which cannot be overloadedasizeof -gt
a in c encapsulation was completed by making things static in a compilation unit or module it prevented another module from accessing the static
a in c the access privileges are public private and protected the default access level assigned to members of a class is private private members of
a this will turn o name mangling for func so that one can connect to code compiled by a c
a in c a struct is alike to a class except for the default access specifier refer to other question in the document in c we ought to include the
a no there is nothing you can do in c which you cannot do in c in spite of
a using the extern c linkage specification around the c function declarationsprogrammers must know about mangled function names and type-safe
a the simplest way is to use a stringstreamincludeincludeincludeusing namespace stdstring itosint i convert int to stringstringstream ss ltlt
what happens if you write following code stringamp
a use references when you can use and use pointers when you have toreferences are generally preferred over pointers whenever you dont require
task 1demonstrate a java client and server exchanging one text message in each directiontask 2demonstrate a c client and server exchanging one text
write three functions in c or c one that declares a large array statically one that declares the same large array on the stack and one
what is the difference among const char mypointer and char const mypointer a const char mypointer is a non constant pointer to constant data
a a reference has to always refer to some object and so must always be initialized pointers do not have such limits a pointer may be reassigned to
is there any difficulty with the following charanull charamp p aa the result is indeterminate you must never do this a reference has to always
a a smart pointer is a c class which mimics a regular pointer in syntax and some semantics however it does more since smart pointers to distinct
a if you employ autoptr objects you would not need to be concerned along with heap objects not being deleted even if the exception is
a the simplest instance of a smart pointer is autoptr that is included in the standard c library auto pointer only takes care of memory leak amp does
a memory that has no pointer pointing to it and there is no method to delete or reuse this memoryobject it causes memory leakbase b new baseout of
a a dangling pointer arises while you use the address of an object after its lifetime is end it may occur in situations such as returning addresses
a by keeping along with the c tradition of theres more than one method to do that translation give programmers options amp tradeoffs so they can