Another question:
the reason that the variables does not change is because:
the whole box (made for the function) is deleted when going back in main. What i mean is that the variables CHANGE but they do not return to the main function so they can printed. Am i correct?
Code:#include <stdio.h> #include <stdlib.h> struct Foo{ int x; int y; }; void f1(struct Foo foo){ foo.x=12; foo.y=13; } int main(void){ struct Foo foo; foo.x=10; foo.y=11; printf("x: %d\n", foo.x); printf("y: %d\n", foo.y); f1(foo); printf("x: %d\n", foo.x); printf("y: %d\n", foo.y); return 0; }