#include int func(int a, int b) { printf("&a = %p\n", &a); a = a + b; return a; } int main() { int value = 10; int result; printf("prima vale: %d\n", value); printf("indirizzo = %p\n", &value); result = func(value, 10); printf("dopo vale: %d\n", value); printf("risultato: %d\n", result); printf("prima vale: %d\n", value); result = func(value, 15); printf("dopo vale: %d\n", value); printf("risultato: %d\n", result); return(0); } /* * The most straightforward way of passing parameters is "by value". * * When you pass a parameter by value, the function makes a local copy * of the variables that you passed. * * That is, inside a function you _cannot_ modify the value of variables * outside the function scope. * */ /* * This function takes two integer parameters. * * The value of the fist parameter is incremented by the value of the * second. * * The result of the sum is returned. */