Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
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
a c unlike only about every other language with exceptions is extremely accomodating while it comes to what you can throw actually you can throw
q what are some ways try catch throw can develop software qualitya by removing one of the reasons for if statementsthe commonly utilized
q but mfc appear to encourage the employ of catch-by-pointer should i do the similara depends if youre utilizing mfc and catching one of their
a depends might be zeroobjects which are thrown must have a publicly accessible copy-constructor the compiler is permitted to generate code which
how do one throw polymorphically a sometimes people write code such asclass myexceptionbase
what does throw with no exception object after the throw keyword mean where wouldi employ ita you should see code that looks something like thisclass
q-what happens while a function throws an exception which was not specified through an exception specification for this functiona unexpected is
is it legal for a member function to say delete thisa as long as youre cautious its ok for an object to delete thisheres how i define cautiousyou
after p new fredn how does the compiler know about n objects to be destructed throughout delete pa the run-time system hold the number of
can i drop the while deleteing array of some built-in type char int etca no you cantsometimes programmers think that the in the delete p only
what if one forget the when deleteing array allocated through new tna all life comes to a disastrous endit is the programmers responsibility not the
a use p new tn and delete p fred p new fred100delete pany time you allocate an array of objects through new generally with the n in the new
q in p new fred does the fred memory leak if fred constructor throws an exceptiona no if an exception take place
a n delete p is a two-step procedure it calls the destructor and then releases the memory the code developed for delete p is functionally similar to
no its not requiredthe c language guarantees that delete p will do nothing if p is equivalent to null as you might get the test backwards and as most