Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If all the free storage in the heap is used up, then new returns the special NUL

ID: 3708260 • Letter: I

Question

If all the free storage in the heap is used up, then new returns the special NULL pointer indicating that the request for more storage could not be satisfied. true or false?

Given the following pointer declarations, pointer p1 will be allocated twice as much storage on main's activation record as pointer p2. class TwoIntRecord { public: Integer x; Integer y; }; int main (int argc, char* argv[]) { Integer* p1; TwoIntRecord* p2; p1 = new Integer; p2 = new TwoIntRecord; delete p2; delete p1; } true or false?

Given the following pointer declarations, pointer p1 will be allocated twice as much storage on main's activation record as pointer p2. class TwoIntRecord { public: Integer x; Integer y; }; int main (int argc, char* argv[]) { Integer* p1; TwoIntRecord* p2; p1 = new Integer; p2 = new TwoIntRecord; delete p2; delete p1; } true or false?

In C++ call to the new operation dynamically allocates a piece of storage from heap memory and marks that storage as in use, so that future calls to new will not allocate the same piece of storage again. true ore false?

Explanation / Answer

If all the free storage in the heap is used up, then new returns the special NULL pointer indicating that the request for more storage could not be satisfied. true or false?

Ans: True

Given the following pointer declarations, pointer p1 will be allocated twice as much storage on main's activation record as pointer p2. class TwoIntRecord { public: Integer x; Integer y; }; int main (int argc, char* argv[]) { Integer* p1; TwoIntRecord* p2; p1 = new Integer; p2 = new TwoIntRecord; delete p2; delete p1; } true or false?

Ans: TRue

In C++ call to the new operation dynamically allocates a piece of storage from heap memory and marks that storage as in use, so that future calls to new will not allocate the same piece of storage again. true ore false?

ANs: True

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote