This is about C in Linux.
I have fork() in main() where I create 2 child processes. Then, in both child process a run the function ab
since you are printing the address of stack variable(local variable). its address will be same(does't matter you update its value or not). since both the process share a common virtual stack.
but if you are trying to print the address of a global variable inside common function(called from parent and child process) then its address will be same till the point you don't update it value. if a process update the value of global variable then that process will have unique copy of it(through copy on write mechanism).