Code Explanation:
In this code, address of i is passed to the function and value of j is passed.
Given i =5, j= 10
void f (int* p, int m) { //here p points to address of i and m contains 5
m = m + 5; // m becomes 15
*p = *p + m; // p becomes 20
return;
}
When call returns back to the main function, i value changes to 20 but j will remain same.
So, printf (‘’%d’’, i + j); // 20 + 10 = 30 is printed