Static variable memory destruction
A static variable is defined in a func开发者_运维知识库tion.Can v destroy its memory outside that function?
If you're talking about C, then no you can't "destroy its memory" - all your static variables are going to be around for as long as your program is running.
What do you mean by "destroy its memory"?
If you mean 'free' the memory, the answer is no.
If you mean overwrite it, the answer is yes (a pointer to the variable can be given to something outside the function that 'owns' it, or a common bug could trash the memory).
精彩评论