Question: 1.What C++ keyword deallocates data on the heap? new delete heap dealloc 2. Given: int *i = 0; int *p; What is the value of

1.What C++ keyword deallocates data on the heap?

new delete heap dealloc 2. Given:

int *i = 0; int *p;

What is the value of p after the following C++ statements?

p = i + 5;

3 20 0 5

3. int *i = new int [50];

What element (not index) does *(i + 2) refer to?

3 2 8 6 4. Given:

int *i = &some_integer_variable;

How many bytes would the following C++ statement move the pointer i?

i += 2;

8 4 1 2 5. If the array "somearray" contains the following elements:

Index Value 0 133 1 714 2 333 3 219

What is printed to the screen after the code below executes?

int *i = somearray + 1; int *p = i + 2; cout << *p;

333 133 714 219 6. If the array "somearray" contains the following elements:

Index Value 0 133 1 714 2 333 3 219 What is printed to the screen after the code below executes?

int *i = &somearray[1]; int *p = i + 1; cout << *p;

219 714 333 133 7.Given:

int *i = 74; int *p;

What is printed to the screen after the following C++ statements?

p = i;

if (p == 74) cout << "true"; else cout << "false";

false true 8. Given the following:

int *i = 20; int *p;

What would be the value of p after the following C++ statements?

p = i + 4;

20 24 36 28 9. What C++ keyword allocates data on the heap?

delete alloc heap new

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!