beginner_h4x3r wrote: > Okay, so the child process was not actually access it's parent > variable, the child given a copy (i have learned about Copy On Write > mechanism too). But it is like a C language issue: we can access any > variable which declared in that function in this case main() function. > So in my code, when i try to access stack_int variable in child > process, it's not wrong, compiler even recognize this as 'valid' > approach... How about my conclusion? What about it? If you compile with warnings enabled, gcc will tell you that the first printf() is using the value of an uninitialised variable. -- Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html