quiz4_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 Winter - 2005 Quiz 4 – Friday 1/28 Each question is worth 1 point. 1. Which of the following function declarations is/are correct, given that we need to pass an array of integers into the function: a. int do_something( int a[10], int a_size ); b. int do_something( int a[], int a_size ); c. int do_something( int a, int a_size ); d. int do_something( int a&, a_size ); 2. How is an array passed into function? a. always by value b. always by reference c. by value or by reference, as desired 3. If we want a search function to search an array for some value and return either the index where the value was found, or -1 if not found, which of the following function declarations would be appropriate? a. void search(const int array, int target, int numElements); b. void search(const int array, int target); c. int search(const int array[], int numElements); d. int search(const int array[], int target, int numElements); 4. Which of the following function declarations will accept the following two-dimensional
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.

This document was uploaded on 04/02/2012.

Page1 / 3

quiz4_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