Write the definition of a function doubleIt, which doubles the value of its argument but returns nothing so that it can be used as follows: int x=5; doubleIt(&x); /* x is now equal to 10 */

LANGUAGE: C++

CHALLENGE:

Write the definition of a function doubleIt, which doubles the value of its argument but returns nothing so that it can be used as follows: int x=5; doubleIt(&x); /* x is now equal to 10 */

SOLUTION:



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