This is just something I was wondering.
Well here goes,
Say I declare a variable in a function, I pass this variable as a pointer to another function.
What happens with this variable when the first function (where the variable is declared) ends?
Does it stay on the stack or does it get removed when the function ends?
Thanks in advance =D
When the function you define a variable returns the variable is destroyed, unless you declared it static. Check storage classes in C. Here is a pointer: http://aelinik.free.fr/c/ch14.htm