Question: Consider the code below: # include stdio.h void myFunction(int x){ x=5 int main(int argc, char const * argv[]){ int y=8; myFunction(&y); printf(%d, y); return

Consider the code below: \# include stdio.h void myFunction(int " x){ x=5 int main(int argc, char const * argv[]){ int y=8; myFunction(\&y); printf("\%d", y); return 0 ; \} What it will print as an output? 5. When myFunction() is called, the pointer x points to the pointer y, which then points to the memory region where the number 8 is. Thus, changes in x will directly affect y. 8. When myFunction() is called, a copy of the address of y is stored in the pointer x. Because they are a copy, changes in y will not affect x. 5. When myFunction() is called, the address of y is stored in the x pointer. The * x changes the value in that address to 5 , which directly affects y. 8 because x and y have different names despite of being the same memory bucket
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
