quiz4_s001_sol

quiz4_s001_sol - CS 012 Intro to Computer Science II Quiz 4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 012 – Intro to Computer Science II Spring - 2005 Quiz 4 Section 001 – Friday 4/22 SOLUTION Each question is worth 1 point. 1. Which of the following statements regarding vectors and arrays is true? a. Functions in C++ can return neither arrays nor vectors b. Functions in C++ can return arrays, but not vectors c. Functions in C++ can return vectors, but not arrays d. Functions in C++ can return both arrays and vectors 2. The new command returns a. The object that it created b. The name of the object that it created c. The address of the object it created d. Nothing – it only has the effect of creating a new object 3. Which of the following statements correctly returns the memory from the dynamic array pointed to by p1 to the heap? a. delete [] p1; b. delete p1[]; c. delete *p1; d. delete p1; 4. Given that p1 is an integer pointer variable, and a1 is an integer array, which of the following statements is not legal code? a.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

quiz4_s001_sol - CS 012 Intro to Computer Science II Quiz 4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online