We have a code.
#include <stdio.h>
int* aa(int s){
static int ad[2] = {0};
ad[0] = s;
printf("aa() -> %p\n", &ad);
return ad;
}
int main(void) {
int *k = aa(3);
printf("main() -> %p\n", &k);
return 0;
}
Compile, run.. output
aa() -> 0x80497d0
main() -> 0xbfbe3e0c
or i misunderstood or this code have problems.
we are returning the same address for static array ad why on output they differ?