#include #include void foo(int *a, int *b); void foo(int *a, int *b) { *a = 5; *b = 6; a = b; } int main(void) { int
a and b are local to the function foo (they are on the stack), when program returns from the function data on the stack is lost. when you assign b to a, you are only modifying memory addresses on the stack, not their values.