If you’ve run into the classic noob C programmer’s problem of “Why won’t my function update my variable?” then you might have resorted to using a global variable instead of passing the variable into the function as a parameter. Global variables allow ‘write access’ to
number from both the caller and the callee, like this,
but global variables are considered bad for lots of reasons. Not least of which is that your function can no longer double anything other than your specific
Instead you need to pass
doubleIt as a pointer parameter.