Practice Quiz 4.3 - Multiple Indirection PDF

Title Practice Quiz 4.3 - Multiple Indirection
Course Intermediate Programming Methodologies in C++ - HONORS
Institution De Anza College
Pages 8
File Size 579.5 KB
File Type PDF
Total Downloads 95
Total Views 138

Summary

Practice Quiz 4.3 - Multiple Indirection...


Description

Question 1

1/1p

Given the following code fragment: int numA, numB; int *p; int **q;

Which one of the following statements makes q point to p?

Correct!

q = &p;

1/8

Question 2

1 / 1 pts

Given the following code fragment: int numA, numB; int *p = &numA; int **q = &p; int ***r = &q;

Which one of the following types is the type of the following expression: ***r

Correct!

int

Question 3

1 / 1 pts

Given the following code fragment: int numA, numB; int *p = &numA; int **q = &p; int ***r = &q;

Which one of the following types is the type of the following expression: https://deanza.instructure.com/courses/18160/quizzes/113731

2/8

&r

Correct!

int ****

Question 4

1 / 1 pts

int list[10] = { 12, 13, 14 }; int a = 3; int *p = list; int **q; q = test(*p + 1, p + 1, &a);

What is the test's function prototype declaration?

Correct!

int **test(int, int *, int *);

3/8

Question 5

0 / 1 pts

This code fragment dynamically allocates an array of n pointers to doubles. int n; double **list; cin >> n; list = new double[n];

There's one error. How would you fix it?

Correct Answer

list = new double *[n];

You Answered

double *list;

Question 6

1 / 1 pts

Assume that the following code is placed in main(): int list[5] = {10, 20, 30, 40, 50}; int *ptr = list + 2; cout...


Similar Free PDFs