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

1. int x; 2. int cherry[10]; 3. foo(x); 4. foo(&x); 5. foo(cherry[3]); 6. foo(ch

ID: 3652872 • Letter: 1

Question

1. int x;

2. int cherry[10];

3. foo(x);

4. foo(&x);

5. foo(cherry[3]);

6. foo(cherry, 3);

7. foo(&cherry[3]);

Illustration 2: Function calls

-----------------------------------

11. Illustration 2: Which line declares an integer?

A. 1

B. 2

C. 3

D. 6

12. Illustration 2: Which line declares an array with 10

elements?

A. 3

B. 5

C. 2

D. 7

13. Illustration 2: Which line calls foo with a copy of an

integer?

A. 4

B. 6

C. 7

D. 3

14. Illustration 2: Which line calls foo with the address of an

integer?

A. 4

B. 3

C. 6

D. 7

15. Illustration 2: Which line calls foo with the address of the

first element of an array?

A. 4

B. 5

C. 6

D. 7

16. Illustration 2: Which line calls foo with the value of an

element of an array?

A. 4

B. 5

C. 6

D. 7

17. Illustration 2: Which line calls foo with the address of an

element of an array which is not the first element?

A. 6

B. 7

C. 5

D. 4

Explanation / Answer

11. Illustration 2: Which line declares an integer? A. 1 12. Illustration 2: Which line declares an array with 10 elements? C. 2 13. Illustration 2: Which line calls foo with a copy of an integer? D. 3 14. Illustration 2: Which line calls foo with the address of an integer? A. 4 15. Illustration 2: Which line calls foo with the address of the first element of an array? C. 6 16. Illustration 2: Which line calls foo with the value of an element of an array? B. 5 17. Illustration 2: Which line calls foo with the address of an element of an array which is not the first element? B. 7