Quiz Yourself on Parameter Passing

Test your understanding of the material presented in this chapter.

Pass by value and pass by reference


Given the following code:

void func(int** a, int* b, int c)
  //some code

int main()
  int* a = NULL;
  int b = 0;
  int c = 1;

  //write the correct call to func

What is the correct way to call func inside main? The first argument should be a, the second should be b, and the third should be c.


func(a, b, c);


func(&a, &b, c);


func(a, b, &c);


func(a, &b, c);

Question 1 of 40 attempted

Get hands-on with 1200+ tech skills courses.