Here's the code:
#include <stdio.h>
#include <stdlib.h>
void foo(int* ptr) {
    printf("ptr is %x\n", ptr);
}
void main() {
    int* ptr = (int*)malloc(sizeof(int));
    printf("ptr is %x\n", ptr);
    foo(ptr);
    free(ptr);
}
...And he're the output:
ptr is 0x007446c0
ptr is 0x00000000
...And here's the question:
Why is this happening to me???
 
     
    