Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
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
q how can one encourage his older compiler to check new to see automatically if it returnsnull a his compiler eventually
a no excluding if you have an old compiler you might have to force the new operator to throw an exception if it runs out of memorythis turns out to
a no while realloc need to copy the allocation this uses a bitwise copy operation that will tear several c objects to shreds c
why should i employ new instead of truthful old malloca constructorsdestructors type safety overridabilityconstructorsdestructors unlike
can i free pointers allocated along with new can i delete pointers allocated along with malloca noit is completely legal moral and wholesome to
how do i allocate multidimensional arrays by newa there are several ways to do this based on how flexible you wish the array sizing to be on one
how does free know the size of memory to be deletedint i int malloc12 followed by freei how did free function call know how much of memory to
problem 1 plugging the memory leak when you employ the normal new operator for example foo p new foo the compiler generates some special code to
write a program called plus that will display asterisks in the shape of a plus sign which has the height and width specified by the user you must
write a program called converter that does three types of metric conversions your program should prompt the user for the selection conversion prompt