F14 Answer


a=77
  *p=77
  *p=123
a=123

Notes:

(1) The way this program works is radically different from how its cousin program Puzzle F11 works. But there are just a few characters different in the code, but they make a big difference. This might call for careful study.

(2) The function newFunction() and the caller main() must coordinate how values are passed. The parameter list of newFunction(int *p) must match the arguments of its call, newFunction( &a ).

(3) A function that has not been written to use pointer values can't be called with pointers. There is no way that main() can call the original function myfunction(int x) that will enable that function to change a.