Skip to the task
Layout
Back to classic view

You are looking at lesson 8. Your place is still lesson 11, task 1: fopen.

CHECKTask 18 of 25 · step 8: Drills: check yourself

Why doesn't a change?

double_it(a) doesn't change a. Why, and how do you fix it?

void double_it(int x) {
    x = x * 2;
}

int a = 5;
double_it(a);
Stuck?

The function doubles a copy. void double_it(int *x) { *x = *x * 2; } and the call double_it(&a).