← Functions & Pass-by-Value vs. Pass-by-Reference

Double In Place

easy

Complete double_value so that it doubles, in place, the int its pointer parameter points to. main is already written to read n, call double_value(&n), and print the result – you’re only filling in the function body.

This is the smallest possible out-parameter: no return value at all, just a pointer the function writes through. If you find yourself trying to return something from double_value, stop – the whole point of this exercise is modifying the caller’s variable through its address instead.

Your solution

"Run" uses the sample stdin ("5"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution